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?
2 Replies
- hoolio
Cirrostratus
Hi,
In theory, the string map command should only ever replace http:// with https:// one time. Can you add logging to the rule to see what the Location header value is before you make the change and after?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]] } }
Aaron - deltapez_21676
Nimbostratus
The log highlighted BigIP as performing correctly. SiteMinder was configured for SSL on ports 80 & 443 creating the extra "s". Fixed. Thanks for your assistance.
D
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