Forum Discussion
Andrew_Abplanal
Feb 28, 2007Nimbostratus
Thanks for the information.....
Here is how I used it.....
The condition here is the client is using SSL to the F5, the F5 based on the URI will send the connection to either HTTP or HTTPS pools.
The Backend server pools are IIS 6 and they return the port they are using when they do a courtesy redirect.
When the backend pool is HTTP it also send the Location back as HTTP so this has to be changed back to HTTPS.
if {[HTTP::is_redirect]}{
log local2. "redirect from SSL"
log local2. "Location = [HTTP::header value Location]"
look to see if there is a string that contains a ":" followed by any number of digits followed by a forward slash
if so, replace that string with a forward slash
regsub {:\d+/} [HTTP::header value Location] "/" location
if the backend server is HTTP the header variable "location" is modified to use HTTPS
HTTP::header replace Location [string map { "http:" "https:" } $location]
log local2. "Fixed Location = [HTTP::header value Location]"
}
}