Forum Discussion
Durga_Dash_2124
Nimbostratus
Jun 02, 2008Shared Virtual Server HTTP to HTTPS redirect
I want to build a single virtual server that will respond to requests both on port 80 and 443. I want port 80 traffic to be redirected to port 443. Also the servers on the internal pool listen on both...
Durga_Dash_2124
Nimbostratus
Jun 03, 2008Here is my final working irule, after cleaning out all the debugging and checking since I know how my virtuals will be built.
Single wildcard virtual server on port 'Any' with ClientSSL profile set and 'http' profile set. Also with a default pool on port 80 and port translation enabled...and cookie persistence.
------------------------------
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 80 }{
set disable_cmd "SSL::disable"
eval $disable_cmd
}
elseif { [TCP::local_port] != 443 }{
reject
}
}
when HTTP_REQUEST {
if { [TCP::local_port] == 80 }{
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
if { [TCP::local_port] == 443 }{
HTTP::header insert SSLClientCipher [SSL::cipher name],\x20version=[SSL::cipher version],\x20bits=[SSL::cipher bits]
}
}
-----------------------------------
Thanks all for your help.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
