Forum Discussion
ML_108504
Apr 14, 2009Nimbostratus
Posted By hoolio on 04/14/2009 8:50 AM
You can get the default pool configured on the VIP using LB::server pool. You'll want to do this before the pool has been selected on the TCP connection, so run LB::server in CLIENT_ACCEPTED:
when CLIENT_ACCEPTED {
Save the name of the default pool
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
if { [matchclass [string tolower [HTTP::header User-Agent]] contains $::bots] } {
pool p_PUB_botfarm
} else {
pool $default_pool
}
}
Denny, I don't think removing the else clause will have the desired result. I don't think a second HTTP request on the existing HTTP connection from a non-bots request would go to the default pool. In general, it's a good practice to explicitly specify a pool for all cases if you do it for any case.
Aaron
OK, this was my plan B (after more forum research), it looks just like your suggestion:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
if { [matchclass [string tolower [HTTP::header User-Agent]] contains $::bots] } {
pool p_PUB_botfarm
} else {
pool $default_pool
}
}
At least we have a test env. to try this on.
Thanks!