Forum Discussion
Rodney_Newton_7
Nimbostratus
Nov 08, 2006Change Host Value
All,
I am trying to do something I thought would be pretty simple but I am missing something... whenever I see a request for www.outsidedomain.com I need to change that to servername. When I...
hoolio
Cirrostratus
Nov 09, 2006I also thought 'HTTP::host mynewhost.example.com' would work, but it doesn't on 9.2.3 either.
I think the value of HTTP::host is cached so you don't see the updated value when setting the host header value with 'HTTP header replace Host newhost.example.com', but the value is actually changed. [HTTP::header Host] apparently isn't cached and therefore shows the correct value.
Regardless, you should be able to confirm by checking the HTTP data sent from the BIG-IP to the node using tcpdump or looking at the node's web server logs.
As for rewriting the responses:
If the web application is sending absolute references which include the internal domain, you could use a stream profile to rewrite oldhost.example.com in the HTTP content.
If you need to rewrite the domain in redirects, you could use a rule (the stream profile won't operate on HTTP headers). Here is an example:
when HTTP_RESPONSE {
if {[HTTP::is_redirect]}{
HTTP::header replace Location [string map { "oldhost.example.com" "newhost.example.com" } [HTTP::header value Location]]
}
}
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