VMware Networking Community
MrSiddiqui
Enthusiast
Enthusiast

NSX Load Balancer_Application Rule to handle Redirection

Hi Guys,

I need some help to write down Application Rule for NSX Load Balancer to handle packet redirection.

There is an iRule (mentioned below) which we are using and need something similar for NSX Application rule.

Kindly assist.

Current iRule on F5:

when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {if { [string tolower [URI::host [HTTP::header Location]]] contains "<yourdomain.com>" and [URI::protocol [HTTP::header Location]] equals "http"} {

     HTTP::header replace Location [string replace [HTTP::header Location] 0 3 https]
}
}
}

==================

Below is the error on http and https redirection issue.

 

Mixed Content: The page at 'https://192.168.172.66/nav_to.do?uri=%2Fem_connector_instance_list.do%3Fsysparm_userpref_module%3D88...' was loaded over HTTPS, but requested an insecure form action 'http://10.183.172.66/em_connector_instance.do?sys_id=-1&sys_is_list=true&sys_target=em_connector_ins...'. This request has been blocked; the content must be served over HTTPS.

 

Reply
0 Kudos
1 Reply
MrSiddiqui
Enthusiast
Enthusiast

HI Guys,

 

After some internet crawling i have found the answer to my question.

You can rewrite the Location header from HTTP to HTTPS. The following sample rule identifies the Location header and replaces the HTTP with HTTP.

rspirep ^Location:\ http://(.*)  Location:\ https://\1

Reply
0 Kudos