Forum Discussion
yuanqiang_22112
Nimbostratus
May 09, 2016irules for different pool
Hi
please look this irules:
when HTTP_REQUEST {
if { [HTTP::uri] contains "login" } {
pool pc
} elseif { [HTTP::uri] contains "hfs" } {
pool pc2
} else {
pool dns
}
}
now I take a ...
Stanislas_Piro2
Cumulonimbus
May 09, 2016Hi,
- HTTP::uri only return URI part of the URL--> starting with the /
- HTTP::host will return the Host part of the URL: login.txhd.com
I recommend you to use switch instead of if / elseif / else
when HTTP_REQUEST {
switch -glob [HTTP::host] {
"login*" {pool pc}
"hfs.txhd.com" {pool pc2}
default {pool dns}
}
}
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