Forum Discussion
Albert__Tase_70
Nimbostratus
Dec 11, 2006need help convert this irule to 9.2.4
if (http_host contains "npg.nature.com") {
use pool pressandgateway
}
else if (http_host contains "press.nature.com") {
use pool pressandgateway
}
else {
di...
Dec 11, 2006
You could use an if statement like this:
when HTTP_REQUEST {
if { [HTTP::host] contains "npg.nature.com" } {
pool pressandgateway
} elseif { [HTTP::host] contains "press.nature.com" } {
pool pressandgateway
} else {
discard
}
}or... you could go with a switch statement which allows for a logical or by using a "-" terminator on a comparison string.
when HTTP_REQUEST {
switch -glob [HTTP::host] {
"*npg.nature.com*" -
"*press.nature.com*" {
pool pressandgateway
}
default {
discard
}
}
}Your choice...
-Joe
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
