Forum Discussion
ashok_102425
Nimbostratus
Feb 10, 2014Pool selection based on header
Dear All,
I am using irules and selecting pools based on header name.
For example if the header is http://mail.sunrise.com go to pool example
if the header is http://sunrise.com go to ...
Kevin_Stewart
Employee
Feb 10, 2014Vitaliy is right on the money I think. The following isn't perfect, but should get you in the right direction.
when HTTP_REQUEST {
set whereis [whereis [IP::client_addr] country]
switch [string tolower [HTTP::host]] {
"mail.sunrise.com" {
if { $whereis equals "GB" } {
pool example
} else {
HTTP::redirect "http://sunrise.com"
}
}
"www.sunrise.com" -
"sunrise.com" {
if { ( $whereis equals "US" ) or ($whereis equals "IN" ) } {
pool sunrise
} else {
drop
}
}
}
}
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