Forum Discussion
Yugandhar
Nimbostratus
Aug 13, 2018Redirect HTTP Traffic to HTTPS on a Nonstandard Port.
Hi,
Could you please help on this requirement:-
Traffic to http or http://test7883.com:80 has to be forwarded to https://test7883.com:8900
HTTP::redirect "https://[getfield [HTTP::hos...
jaikumar_f5
Noctilucent
Aug 14, 2018You can't run http and https on the same ports (8900).
Update: I stand corrected, looks like it can be done,
when CLIENT_ACCEPTED {
Set a variable to track whether this is an HTTPS request
set https 0
}
when CLIENTSSL_HANDSHAKE {
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)}{
HTTP::redirect https://[getfield [HTTP::host] : 1][HTTP::uri]
}
}
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