jgranieri
Jan 20, 2012Nimbostratus
Help with logic on header check irule
Hello All,
So i have an irule in which I need to check http header for mozilla then check the URI then LB appropriately. after this condition I have 2 other URI that are from a browser and need to be LB appropriately.
So If /aaa does not come from mozilla send to pool aaa, otherwise send to zzzz
/bbb and /ccc are browser based and need to go to the respective pools.
I know I have the default pool at the end but i need to somehow that with an else after the
"*/aaa*" { pool aaa }
{else}
pool zzz}
/bbb and /ccc are browser based and will contain mozilla in the header field
when HTTP_REQUEST {
if { not [string tolower [HTTP::header Accept]] contains "Mozilla" } {
switch -glob [HTTP::host][HTTP::uri] {
"*/aaa*" { pool aaa }
"*/bbb*" { pool bbb }
"*/ccc*" { pool ccc }
default {
pool zzz }
}
}
}