Forum Discussion
Eddie_27920
Nimbostratus
Jan 07, 2015New to iRules and trying to get port translation to work
I have a website that is HTTP, a VIP built on HTTP with the following iRule:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if { $host eq "solidwaste.dev.mesaaz.gov"} {
pool solidwaste.de...
Michael_Jenkins
Cirrostratus
Jan 07, 2015On your back end servers, are you checking for specific host headers to route the traffic? I don't think the host header is designed to include the port number. Within your pool, it should send the request to whatever port is specified. Updated code below that may help (and I find the switch command a little cleaner, so I changed the if to switch):
when HTTP_REQUEST {
switch -glob -- [string tolower [HTTP::host]] {
"solidwaste.dev.mesaaz.gov" {
pool solidwaste.dev.mesaaz.gov
}
"*swfm1.mesaaz.gov*" {
pool swfm1.mesaaz.gov
}
"*swfm2.mesaaz.gov*"{
pool swfm2.mesaaz.gov
}
}
} 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