mjbeadle
Jul 11, 2013Nimbostratus
Odd behavior with uri match irule
I started with the following iRule-
when HTTP_REQUEST {
set app_pool [class match -value -- [HTTP::uri] starts_with "URIs"]
if {$app_pool ne ""} {
pool $app_pool
}
}
URIs is a data group string:=pool
The page would load, all from strings that matched the data group list.
Clicking a link on the first page that was not in the data group list would result in a 404. We found it was still sending the request to the pool like it had matched a string in the data group.
I changed the irule to the following and it seems to work correctly (although moderately slow)
when HTTP_REQUEST {
set app_pool [class match -value -- [HTTP::uri] starts_with "URIs"]
if {$app_pool ne ""} {
pool $app_pool
log local0. "IF"
}
else {
log local0. "Else"
pool pool_in_vip
}
}
The way it was explained to me, using the first rule code, if the uri does not match the data group it should send the request to the default pool configured in the virtual server.
Anyone able to set me straight on this?
Thanks-
Mike