Forum Discussion
astokes_6920
Nimbostratus
Nov 11, 2010Rewrite host header to specific pool member
I've done basic host header rewrites rules in the past but I've just received an odd request that's beyond me. I'm scrapping together a solution from multiple posts but haven't got anything to pass y...
nitass
Employee
Nov 13, 2010not sure if i understand correctly. pls feel free to revise.
v10.1.0
virtual bar {
snat automap
pool foo
destination 172.28.17.55:http
ip protocol tcp
rules myrewrite
profiles {
http {}
tcp {}
}
}
pool foo {
members {
10.10.70.110:http {}
10.10.70.120:http {}
10.10.70.130:http {}
}
}
class myhost {
{
"10.10.70.110" { "node1" }
"10.10.70.120" { "node2" }
"10.10.70.130" { "node3" }
}
}
rule myrewrite {
when HTTP_REQUEST_SEND {
clientside {
if {[HTTP::host] equals "172.28.17.55"} {
HTTP::header replace Host "[class match -value [LB::server addr] equals myhost]"
}
}
}
}
client side:
GET / HTTP/1.1
Host: 172.28.17.55
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
server side:
GET / HTTP/1.1
Host: node3
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
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