Thiyagu
Jan 24, 2023Cirrus
Need help with an iRule to match multiple URI and redirect the http request to a pool
Hello Friends,
Hope you all are doing good. I'm working on an iRule to match the multiple URI and route the request to a specific pool.
Please find below the iRule. Could you please review and let me know is there anything needs to be added or removed or is there any other best possible ways to achive this?
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/next/x1/*" -
"/next/x2/*" -
"/next/x3/*" -
pool POOL_NEXT_X
}
{
"/next/y1/*" -
"/next/y2/*"
pool POOL_NEXT_Y
}
{
"/next/a1/*"-
pool POOL_NEXT_A
}
{
"/next/b1/*"
pool POOL_NEXT_B
}
{
"/next/c1/*"
pool POOL_NEXT_C
}
}