Forum Discussion
Rewrite Response Header coming from pool members?
Hi there,
I'm running 11.6 LTM. I'm publishing Oracle iSupplier to the internet but my hostnames differ from inside to outside. I'm using an iApp (f5.http) to do this. I've set the iApp to use SSL offload since our internal server is not SSL. The issue I'm running into is that when I hit the login page, I'm getting sent to non-ssl with the internal hostname. I'm running F12 Developer Tools on my browser and see where the "Response header" "Location" is the one sending me there. On my old proxy server (Microsoft ISA), the pool node sends the same response but the ISA Proxy module is rewriting the location with https and the external host name.
Can someone assist me with creating a rule to do this?
Thanks alot, Chris
4 Replies
- amolari
Cirrostratus
try this quick and dirty.. based on a search on Devcentral..
when HTTP_RESPONSE { if { [HTTP::status] contains "302"} { if { [HTTP::header location] starts_with "http:///" } { log local0. "Location header matches : [HTTP::header location]" HTTP::header replace location "https:///[HTTP::uri]" } } } - stupid48
Altocumulus
Thanks for the info.
I get this when I try to use this rule:
error: [command is not valid in current event context (HTTP_RESPONSE)][HTTP::uri]
I'll keep searching...
- Stanislas_Piro2
Cumulonimbus
[HTTP::uri] is not available in HTTP_RESPONSE EVENT.
the following irule correct the issue.
when HTTP_REQUEST { set url [HTTP::uri] } when HTTP_RESPONSE { if { [HTTP::status] contains "302"} { if { [HTTP::header location] starts_with "http:///" } { log local0. "Location header matches : [HTTP::header location]" HTTP::header replace location "https:///$url" } } } - stupid48
Altocumulus
I found a different way but I appreciate the starting point. I'm really a beginner to the irules...
when HTTP_RESPONSE { if { [HTTP::status] contains "302"} { if { [HTTP::header location] starts_with "" } { log local0. "Location header matches : [HTTP::header location]" HTTP::header replace location [string map {"" ""} [HTTP::header Location]] } } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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