Forum Discussion
Greg_Harris_111
Nimbostratus
Feb 02, 2006Redirect to HTTPS with no HTTP site
I see in the forums that redirect has been covered a lot. But here is my issue: can I force a client coming in to BIG-IP with http://www.domain.com to https://www.domain.com without have an http vip l...
JRahm
Admin
Feb 02, 2006To expand on Colin's response, you have the option of setting up a wildcard virtual server that listens on all ports, then use iRules to pick up the ones you are interested in. Here's some sample code to get you started.
rule http_redirect {
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 443 } {
set serverport https
} elseif { [TCP::local_port] == 80 } {
set serverport http
} else { discard }
}
when HTTP_REQUEST {
if { [TCP::local_port] == 80 } {
redirect https://[HTTP::host][HTTP::uri]
}
}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
