Faintly_Lucky
Apr 09, 2010Nimbostratus
iRule Pool Selection Question
Anyone that knows, please feel free to answer this question.
When I use an iRule to select a pool based on URI, it chops off the first directory of the URI. Example:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool] }
when HTTP_REQUEST {
pool $default_pool
set uri [string tolower [HTTP::uri]]
set query [URI::query [HTTP::uri]]
if { $uri starts_with "/smartphone" } {
pool pool_name
return
}
}
In this case when it sees “/smartphone,” it selects just fine, but to “/”, not “/smartphone”. Is this normal? If I’m selecting a pool that has the same servers in it, I have to set the URI to include the first directory by adding this after the pool statement and before the return:
if { not ([HTTP::uri] starts_with "/smartphone") } {
HTTP::uri /smartphone[HTTP::uri] }
If I'm doing something wrong here, please don't hesitate to let me know.
Comments?