iRule - Pool member Failover
Hi,
PFB iRule.
Purpose: 1 VS for 3 application and redirection on the basis of host name.
for each application we have different Pool. If pqr.com or xyz.com not working redirect to abc.com
Issue: It is working perfectly if we have 3 very different URL, not working when we have one parent domain and 2 other different sub-domain.
when HTTP_REQUEST
{ switch -glob [HTTP::host]
{ abc.com { pool Pool_1
} pqr.com {
if { [HTTP::uri] contains "pqr" && [active_members Pool_2]>=1 }
{ pool Pool_2 }
else
{ HTTP::redirect http://abc.com }
}
xyz.com {
if { [HTTP::uri] contains "xyz" && [active_members Pool_3]>=1 }
{ pool Pool_3 }
else
{ HTTP::redirect http://abc.com }
}
default { HTTP::redirect http://abc.com }
}
}