msdatla_64383
Aug 16, 2013Nimbostratus
Selecting another Virtual from and iRule of one Virtual ? URI based routing ?
Hi guys,
Is there a way that we can select new virtual from the iRule of one Virtual server? i tried "LB::reselect virtual vs1" but it didn't worked.
I am trying to implement URI based routing between two apps ( website/vip1 || website/vip2 should go to one app1 and everything else should go to another app2)
app1 is a webapplications which has its own iRule which does some additional tasks like inserting new headers and some redirects
app2 is just a static web site
here is the first iRule
when HTTP_REQUEST {
if {
([HTTP::uri] starts_with "/vip1") ||
([HTTP::uri] starts_with "/vip2")
} then {
pool pool1
} else {
pool pool2
}
}
when LB_SELECTED {
log local0. "[LB::server addr] is selected"
if {
([LB::server addr] eq "192.168.68.46") ||
([LB::server addr] eq "192.168.68.45")
} then {
log local0. "[LB::server addr] is selected"
LB::reselect virtual vs2
} } `