Forum Discussion
Can Someone tell me the best way to create an HTTP to HTTPS redirection.
Create two virtuals with the same IP but with different ports. 80 and 443. On the VIP using port 80, include an irule for the http to https redirect. (You can disregard the other parameters but this should get you in the right direction)
ltm virtual yoursite_80 { destination 123.456.78.9:http ip-protocol tcp mask 255.255.255.255 pool yoursite profiles { http { } tcp { } } rules { http-to-https } source 0.0.0.0/0 source-address-translation { type automap } vs-index 26 }
ltm virtual yoursite_443 { destination 123.456.78.9:https ip-protocol tcp mask 255.255.255.255 persist { cookie { default yes } } pool yoursite profiles { Http_compression { } Http_compression-compression { } yoursite { context clientside } tcp { } } source 0.0.0.0/0 source-address-translation { type automap } vs-index 25 }
ltm rule http-to-https { when HTTP_REQUEST { 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
* 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