Forum Discussion
Barry_Gavenda_3
May 02, 2019Nimbostratus
Change Host header for each node in a pool
I need to change the host header on each pool member. IE the incomming host header is 1.site.com. I set up a pool of servers, but each needs to have its OWN host header.
a.something.local
b.somethi...
youssef1
May 02, 2019Cumulonimbus
Hi,
try this:
You just need to modify IP by your backend IP and needed host.
when LB_SELECTED {
if { [LB::server addr] eq "10.1.1.1" } {
set host "1.site.com"
} elseif { [LB::server addr] eq "10.1.1.2" } {
set host "2.site.com"
} elseif { [LB::server addr] eq "10.1.1.3" } {
set host "3.site.com"
} else {
set host [HTTP::header "Host"]
}
}
HTTP_REQUEST_RELEASE {
if { [HTTP::header exists "Host"] } {
HTTP::header replace Host $host
} else {
HTTP::header insert Host $host
}
}
}
Keep me in touch. regards,
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