Sabir_Alvi
Feb 13, 2020Altocumulus
Redirect requests to second VIP (VIP to VIP redirection)
We have 2 different VIPs created with different profile configurations. We need to redirect traffic for a particular URI to the Second VIP, while everything else is handled by the First VIP. We have tried below iRules but it hasn't helped, the request is not getting redirected to Second VIP. Any help would be highly appreciated!! We have logging enabled and it only says the request was sent to the pool on First VIP.
when HTTP_REQUEST {
log local0. "Request to: [HTTP::host] from [IP::client_addr]"
switch -glob [string tolower [HTTP::host][HTTP::uri]] {
"something.com/blah/blah/blah.svc*" {
virtual second_vip_name
}
}
}
when HTTP_REQUEST {
log local0. "Request to: [HTTP::host] from [IP::client_addr]"
set uri [string tolower [HTTP::uri]]
if { ( $uri contains "/blah/blah/blah.svc")
} {
virtual second_vip_name
}
}
I referred this as well - https://devcentral.f5.com/s/articles/20-lines-or-less-64-vip-to-vip-redirection-url-separation-and-redirect-rewriting