Forum Discussion
Jay_Austad_7258
May 13, 2008Nimbostratus
I got it. I set up the redirect from HTTP to HTTPS iRule provided in the codeshare on this site. Then on the port 443 VIP, I just used the following iRule. It requires all of the VIPs to be named with the FQDN followed by "-443". It uses [virtual] to figure out the name of the VIP, strips the -443, and uses that to check against what the client is providing. Works awesome.
when HTTP_REQUEST {
Set our required hostname based on the VIP name
All vips must be named with the FQDN with "-443" appended
set ::myhostname [getfield [virtual name] "-443" 1 ]
log local0. "Virtual Server: $::myhostname"
if { not ( [HTTP::host] equals $::myhostname ) } {
HTTP::redirect "https://$::myhostname[HTTP::uri]"
}
}