I have a simple iRule that tries to send requests for certain urls to a custom pool rather than the default pool associated with the virtual server:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with “/myapp” } {
pool “myapp_pool”
}
}
I have noticed that for a browser making requests to urls that both match and don’t match /myapp, some of the non /myapp urls will go to the myapp_pool rather than the default pool.
This construct (which I’ve seen in some DevCentral posts) seems to work reliably:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
if { [HTTP::uri] starts_with “/myapp” } {
pool “myapp_pool”
} else {
pool $default_pool
}
}
Is this the ‘correct’ way to ensure that the request goes to the correct pool?
Thanks.