Forum Discussion
HTTP to HTTPS redirect over the same port
Hello,
i hope you can help me. I need an http to https redirect to the same port. For example I enter the URL http://dev.intern.com:25001 and I want to get redirected to https://dev.intern.com:25001. I tried a second virtual server but this didn't work because the loadbalancer can't have two the same IP and ports for a second server which redirects it with an irule to the https virtual Server which is understandable.
Thank you already and best regards!
2 Replies
- Vijay_E
Cirrus
Where are you terminating the SSL - on F5 or servers ?
I am not sure if you know this but you can have a set up like this: VS:80 VS:443
Both VS can then be attached to a common pool with pool members listening on port 25001 and you can have HTTP to HTTPS redirect iRule on VS:80
- gasch_297596
Nimbostratus
Hello,
we found the solution for the Problem. A few years ago a person had the same problem:
https://devcentral.f5.com/questions/http-to-https-redirect-on-non-standard-port
So you just have to use the iRule:
when CLIENT_ACCEPTED { set https 0 } when CLIENTSSL_HANDSHAKE { set https 1 } when HTTP_REQUEST { if {not ($https)}{ HTTP::redirect https://[HTTP::host][HTTP::uri] } }And to activate non-SSL in your SSL Profile under Local Traffic -> Profiles -> SSL -> Client -> (Profile you are using)
After that you are able to set the iRule on your SSL virtual server.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
