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
} } `
Any chance your internal virtual (vs2) is using a client SSL profile? And you’re not using a server SSL profile on the external VIP? Try this just to simplify things:
when HTTP_REQUEST {
virtual vs2
}
Then just purposefully go to “/vip1” to test. Does this get you to the internal VIP?