Forum Discussion
deltapez_21676
Nimbostratus
Apr 21, 2008http to https irule
The following irule was added to redirect any HTTP response from the port 80 web servers to HTTPS. It seems to have a recursion problem and will return an extra "s" (HTTPsS://example.com) in the URL.
when HTTP_RESPONSE {
if { [HTTP::status] == "302" } {
respond with 302 using original Location value
HTTP::respond 302 Location [string map {"http://" "https://"} [HTTP::header Location]]
}
}
In reviewing the captured headers, the following format is intermittently returned:
Location: HTTPsS://example.com
Any suggestions on a better approach that will retain query data, post info, and cookies?
- hoolio
Cirrostratus
Hi,when HTTP_RESPONSE { if { [HTTP::status] == 302" } { log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting [HTTP::header Location] to [string map {http:// https://} [HTTP::header Location]]" respond with 302 using original Location value HTTP::respond 302 Location [string map {"http://" "https://"} [HTTP::header Location]] } }
- deltapez_21676
Nimbostratus
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