Block URIs and forward traffic 2 pools on same VIP
Hi Team,
We currently have a requirement for single VIP to service 2 URLs and also to check URI and only allow 4 specific URIs.
I currently have it as 2 different VIPs with 2 pool and have an irule attached to it block URIs as below which is working as expected to allow specific URIs
when HTTP_REQUEST {
switch -glob [HTTP::uri]]
"/abc*" -
"/bcd*" -
"/efg*" -
"/cvy" -
{
}
default
{
drop
}
}
}
I have prepared another irule which can be used to pass the traffic specific pool depending on the hostname.
when HTTP_REQUEST {
set hostname [string tolower [HTTP::host]]
switch $hostname {
"abc.com" {
pool abc_pool
}
default {
do nothing use the pool for VIP
}
}
}
Can I combine these irules to achieve which i wanted or would it be easier to use ltm policy?