Forum Discussion
Jason_48455
Nimbostratus
Jun 30, 2008HTTP to HTTPS redirect on non-standard port
I have a web application that is running on a non-standard port. We need to have SSL on it. I applied the client certificate and https works fine, but if we enter http we get a page cannot be displa...
hoolio
Cirrostratus
Jun 30, 2008Do you have non-SSL enabled on the client SSL profile? This will be required in order to issue a redirect on a non-SSL request.
If it still doesn't work, can you try this version with logging:
when CLIENT_ACCEPTED {
log local0. "[IP::client_addr]:[TCP::client_port]: new connection to [IP::local_port]:[TCP::local_port]. https 0"
Set a variable to track whether this is an HTTPS request
set https 0
}
when CLIENTSSL_HANDSHAKE {
log local0. "[IP::client_addr]:[TCP::client_port]: new connection to [IP::local_port]:[TCP::local_port]. https 1"
There was a client side SSL handshake, so update the variable
set https 1
}
when HTTP_REQUEST {
If it's not an HTTPS connection, send a redirect
if {not ($https)}{
log local0. "[IP::client_addr]:[TCP::client_port]: new connection to [IP::local_port]:[TCP::local_port] redirecting http"
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
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