Forum Discussion
Jeroen_V_95572
Aug 17, 2011Nimbostratus
Outgoing header modification
Hello All,
I have a little problem on a BIG IP ASM v10 system.
I have created the following irule:
when HTTP_REQUEST {
set uri [HTTP::uri]
}
whe...
hooleylist
Aug 17, 2011Cirrostratus
Sorry, I just realized the protocol wasn't prepended to the Location header. So the browser interprets it as a local URI which it appends to the requested protocol, host and URI. If you use this it should work:
when HTTP_REQUEST {
set uri [HTTP::uri]
set host [HTTP::host]
}
when HTTP_RESPONSE {
log local0. "[IP::client_addr]:[TCP::client_port]: URI: $uri, status: [HTTP::status], Location: [HTTP::header "Location"]"
if { [HTTP::is_redirect] and [HTTP::header "Location"] starts_with "http://www.backendserver.com"} {
HTTP::header replace "Location" "https://$host$uri"
log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting Location to https://$host$uri"
}
}
Aaron
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