Volodymyr_32240
Nov 15, 2018Nimbostratus
iRule which check uri or path contains
I need to do iRule which check uri or path and send traffic to different pools, and when client try connect to "testweb.com/api/app/1/workstation-params/100" it wiil go to "testweb.com/api/app/workstation-params/100" and pool "pool1"
When client try "/api_aaa" - go to pool "pool2"
When try only "testweb.com/" - go to pool "pool2"
I have irule, but it doesn't work correctly.
when HTTP_REQUEST {
if { [HTTP::uri] contains "/api/app/1/" } {
HTTP::path "/api/app/"
}
elseif { [HTTP::uri] contains "/api/app/" } {
pool pool1
}
elseif { [HTTP::path] equals "/api_aaa"} {
pool pool2
} else {
pool pool2
}
}