Forum Discussion
jkeyser_44143
Nimbostratus
Aug 12, 2009Help with irule to re-write http to https and keep uri
I have a virtual server listening on 443 and using ssl. The pool that this points to uses http over port 8080. When a user hits the LTM virtual server they get redirected by the nodes in the pool to http and a new URI. The address bar shows the redirect as desired but the protocol is now HTTP instead of HTTPS. Simply putting https into the browser address bar corrects the problem.
for example.
user goes to https://host
the response they get back is http://host/uri
I need the response they get back as https://host/uri
What is a simple I rule that I can use that will take the HTTP response that the node gives, convert it to https and keep the URI that the node directed the user to. I have tried the simple redirect on HTTP_REQUEST script below but it does not work.
Any help?
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] ":" 1]
}
- dennypayne
Employee
That rule does not preserve the URI so every request would be redirected to just the domain name.when HTTP_REQUEST { HTTP::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