iRule for load balancing to different virtual server depending on the URI path
Hi Guys,
I have three Virtual Server to be configured on our LTM's which are running on the version 15.1.7. One virtual server is facing to client (let say VS-A) and contains two virtual server (let say VS-B and VS-C) that should be load balance.
VS-B and VS-C need to load balance on the VS-A but the incoming traffic should be clasify use the uri /path.
The conditions like this:
if the uri contains /aa, /bb, /cc will be forward and load balance to VS-B and VS-VS-C.
I tried to make irules like this:
when HTTP_REQUEST {
if { [HTTP::uri] contains "/aa,/bb,/cc" } {
virtual VS_B
} else {
virtual VS_C
}
}
But the results is traffic from the client always going to the VS-B, so the load balancing doesn't have running.
I don't know it can be configured with the iRules or not, since I am not an expert in writing the iRules can anyone suggest me with the iRules that helps working the VIP as mentioned above.
Appreciate any kind your insight.
Thanks