Forum Discussion
Brian_DeKemper_
Nimbostratus
Feb 03, 2007HTTPS to HTTP redirect
This one is a little different, but I'm trying to redirect traffic on a 443-Virtual Server over to a port 80 Virtual Server.
I have an 'HTTP to HTTPS redirect' iRule, but I'm in a situation ...
hoolio
Cirrostratus
Jul 08, 2008Citiizen_elah is correct. Though, if you can import the SSL cert and key, there is another option. If you want to pass the SSL through LTM encrypted during normal operations but send a redirect during maintenance, you could adapt this example (Click here) to read a "maintenance" flag. If the maintenance variable was enabled, then LTM would decrypt the SSL and respond with a redirect.
This would require you to import the SSL cert and key and add a client SSL profile and an HTTP profile to the VIP. The two profiles would only be enabled during the maintenance window.
when CLIENT_ACCEPTED {
Set this flag to 1 to decrypt the SSL and send a redirect to the client. Set to 0 to pass the SSL through without decrypting it.
set maintenance_redirect 1
log local0. "[IP::client_addr]:[TCP::client_port]: Received connection with maintenance flag set to $maintenance_redirect"
Check if the maintenance flag is disabled (set to 0)
if {$maintenance_redirect==0}{
Disable the client SSL profile so the HTTPS traffic is passed through encrypted to the node
SSL::disable
Disable the HTTP profile as we're not going to redirect this request
HTTP::disable
log local0. "[IP::client_addr]:[TCP::client_port]: Maintenance flag is disabled"
}
}
when HTTP_REQUEST {
The HTTP_REQUEST event is only triggered if the maintenance flag is enabled and the client SSL and HTTP profiles are left enabled
Redirect the client
HTTP::redirect https://maintenance.example.com
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting request"
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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