Forum Discussion
GJR-UK_248612
Nimbostratus
Jan 25, 2018irule to change http host based on port
Hi all, I have a need to change a http host based on port.
I have four virtual servers - same IP address but each listening on 443, 444,446,447.
The need is for all traffic to be sent to server.d...
Stanislas_Piro2
Cumulonimbus
Jan 25, 2018Try this:
when HTTP_REQUEST {
if { ([HTTP::host] eq "server.domain.co.uk") } {
switch [TCP::local_port] {
443 {
HTTP::host "server-443.domain.com"
pool POOL_443
}
444 {
HTTP::host "server-444.domain.com"
pool POOL_444
}
446 {
HTTP::host "server-446.domain.com"
pool POOL_446
}
447 {
HTTP::host "server-447.domain.com"
pool POOL_447
}
}
}
}
or even better
when HTTP_REQUEST {
if { ([HTTP::host] eq "server.domain.co.uk") } {
HTTP::host "server-[TCP::local_port].domain.com"
pool POOL_[TCP::local_port]
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
