Forum Discussion
GavinW_29074
Apr 16, 2012Nimbostratus
Random HTTPS Redirects?!?!
Hi there,
I'm starting to configured some services on the F5 which support HTTP. Prior to this, all our services have been over HTTPS.
However I'm having some issues with random HTTPS redire...
GavinW_29074
Apr 16, 2012Nimbostratus
Ok, think I've got a work-around to this issue...
As I'm using ProxyPass, I thought it's the logical place to make the correction, rather than relying on redirect-rewrite in the HTTP Profile.
Below is a patch that I've generated against the v10.5 ProxyPass rule.
Logic was that the additional correction of the Redirect location value is only required when the rule is not rewriting the Response Payload, as the Location is rewritten already as part of that process.
Was also only interested in Redirect responses as application links are fine.
Comments welcome.
Gav
@@ -474,6 +476,20 @@
log local0. "$log_prefix: Rewriting response content enabled, but disabled on this response."
}
+ Check for Redirect responses
+ if { [HTTP::is_redirect] } {
+if { $static::ProxyPassDebug > 1 } { log local0. "$log_prefix: Response is redirect. Checking Location Header."}
+
+ Get the protocal from the Location header value.
+set redirect_proto [string range [HTTP::header "Location"] 0 [expr [string first : [HTTP::header "Location"]] +2]]
+if { $static::ProxyPassDebug > 1 } { log local0. "$log_prefix: Redirect Proto is: $redirect_proto." }
+if { not ($redirect_proto == $protocol) } {
+if { $static::ProxyPassDebug > 1 } { log local0. "$log_prefix: Redirect Proto doesn't match request protocol. Correcting." }
+HTTP::header replace Location [string map -nocase "$redirect_proto $protocol" [HTTP::header Location]]
+}
+
+ }
+
Need to explicity disable the stream filter if it's not needed for this response
Hide the command from the iRule parser so it won't generate a validation error
when not using a stream profile
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