Forum Discussion
babaransari_361
Nimbostratus
May 17, 2018HTTP to HTTPS redirection using only a single virtual server
i need to configure http to https redirection using a single virtual server which will be listening on port 443. This virtual server will communicate with the backend servers on port 8080. Hence any ...
jurgenvdmark_14
Nimbostratus
May 17, 2018I'm using the following rule for this purpose. It basically strips the host part of http redirects and returns the relative path:
ltm rule redirect_absolute_to_relative {
when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {
Replace absolute redirect with relative redirect
HTTP::header replace Location [regsub {https?://[^/]*/} [HTTP::header value location] "/"]
}
}
}
Hope this answers your question
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