Forum Discussion
Need help for replacing header in HTTP_RESPONSE
We are using F5 as the proxy server between client and destination. We need to replace the Host of a URL in both forward and reverse flow. Forward case is working as expected, but Reverse doesn't seem to replace. Any suggestions would be greatly appreciated. Also can you suggest a way to add log debug statements to print the header after it gets replaced in the log?
- Forward: From Client as "service-t-client.com" to destination "service-2.destination.com"
- Reverse: From destination "service-2.destination.com" to Client "service-t-client.com"
iRule is as follows:
when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "service-t-client.com" { HTTP::header replace Host "service-2.detination.com" } } }
when HTTP_RESPONSE { foreach header {"service-2.destination.com"} { HTTP::header replace Host "service-t-client.com" } }
- jaikumar_f5
Noctilucent
Refer the ProxyPass v10/v11 Codeshare.
- iaine
Nacreous
Hi
In your HTTP_RESPONSE code you are looking for a header called service-2.destination.com rather than looking for a header value.
Does something like this work?
when HTTP_RESPONSE { if {[HTTP::header "Host" equals "service-2.destination.com" } { HTTP::header replace Host "service-t-client.com" } }
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