Chris_103315
Mar 04, 2008Nimbostratus
HTTP_REQUEST event bypassed?
I'm writing an iRule in our production environment to split traffic based on URI. All works fine except there is one request that seemingly doesn't fall into any case and is in turn load-balanced between the enabled nodes in default pool.
basically for all requests I want:
/forums -> node 1-3
/account -> node 4-6
/api -> "special pool" of 2 nodes
Everything else -> node 7-9
The problem is that I still see a single request (for example /forums/posts.aspx) go to all nodes when it should only go to 1-3. I also have verified that the request is serviced by the default pool of all 9 nodes by disabling all but a couple nodes and seeing that the /forums/posts.aspx only goes to the enabled nodes. The rest of the traffic is correctly segmented via the iRule. If this was a parse error on the URI this request should fall into the else block and only go to 7-9.
I want to use iRules to control all requests, but it seems there are circumstances "when HTTP_REQUEST" event doesn't fire or isn't caught. Does anyone know what might cause this?
An example of the iRule:
when HTTP_REQUEST priority 100
{
if {[string tolower [HTTP::uri]] starts_with "/forums/" }
{
pool POOL01_03
}
elseif {[string tolower [HTTP::uri]] starts_with "/account/" }
{
pool POOL04_06
}
elseif {[string tolower [HTTP::uri]] starts_with "/api/"}
{
pool POOLAPI
}
else
{
pool POOL07_09
}
}