some basic irule logic... where am I going wrong?
Hi,
I've got an irule doing the following:
switch -glob [HTTP::uri] {
"/con1" -
"/con1/*" {
pool pool-1
return
}
"/con2" -
"/con2/*" {
pool pool-2
return
}
However, for all sorts of reasons that I won't get into, I need to alter the above to punt anything for /con1/con2/* to pool-2
I've tested this and consistently get feedback from our testers to say "no dice". Soem basic browser tests would seme to confirm this.
I place my context switches in the following order:
"/con1/con2" -
"/con1/con2* -
"/con2" -
"/con2/*" {
pool pool-2
return
}
"/con1" -
"/con1/*" {
pool pool-1
return
}
and even tried string substitution like so to no avail:
"/con2" -
"/con2/*" -
"/con1/con2/*" {
HTTP::uri [string map { "/con1/con2/" "/con2/" } [HTTP::uri]]
pool pool-2
return
}
Is the /con1/* or /con1/ overriding the first context switch and/or all subsequent switches? It seems to work fine if I use something along the lines of:
"/con1" -
"/con1/*" {
pool pool-1
return
}
"/con1-3" -
"/con1-3/*" {
pool pool-3
return
}
Thanks!