Forum Discussion
Kevin_Stewart
Nov 15, 2013Employee
Just for clarification, do you mean a pool or a pool member? A separate pool, or separate VIP as Steve says, would be easier.
when CLIENT_ACCEPTED {
collect the default configured pool for the VIP
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"localtest.domain.com" {
if request to test server, and is local IP, and test pool is up
if { ( [IP::addr [IP::client_addr] equals "x.x.x.x/x"] ) and ( [active_members localtest_pool] > 1 ) } {
pool localtest_pool
} else {
otherwise send to regular pool
pool $default_pool
}
}
default {
send all regular traffic to assigned pool
pool $default_pool
}
}
}
The above would trigger the IP and active_members evaluation if the request was for the "localtest.domain.com" host, assuming multiple host names resolved to the same VIP address. All other traffic would be routed to the VIP-assigned pool.