Forum Discussion
John_Ferrin
Nimbostratus
Jun 24, 2010HTTP to HTTPS Redirect with Specified Port
I have a virutal server listening on port 444 that is setup for https traffic. What I'd like to accomplish with an iRule (or some other method) is to look for http requests (http://servername.hostna...
hoolio
Cirrostratus
Jun 24, 2010Hi John,
If you enable non-SSL connections on the client SSL profile you can use an iRule like this to redirect non-SSL requests via HTTPS:
http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&postid=1170929&ptarget=1170978
when HTTP_REQUEST {
Check if the client used an SSL cipher
if {not ([catch {SSL::cipher version} result]) && $result ne "none"}{
Client did use a cipher
log local0. "\$result: $result. Allowing ncrypted request."
} else {
Client did not use a cipher
log local0. "\$result: $result. Redirecting unencrypted request."
HTTP::redirect "https://www.example.com/"
}
}
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