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...
jaikumar_f5
May 02, 2019MVP
Hi Barry,
Have seen these requirements in the past and there's been lot of solutions shared too. Don't want to reinvent the wheel, follow these links and you'll find the solutions,
Rewrite Host Header to Server IP:port
Rewrite Host Header to Server Name
You'd have to create a Data Group and an Irule for this.
Data Group:
ltm data-group internal ip_to_host_dg {
records {
1.1.1.1 {
data host1.example.com
}
1.1.1.2 {
data host2.example.com
}
1.1.1.5 {
data host3.example.com
}
}
type string
}
Irule:
when HTTP_REQUEST_SEND {
clientside {
set host_header_value [class match -value [IP::server_addr] equals ip_to_host_dg]
if {$host_header_value ne ""}{
HTTP::header replace Host $host_header_value
}
}
}
Again you can modify the host header for the http response back to the client. hope this helps.
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