Mar 06, 2015
BIG-IP : iRule to route uri-forms for all hosts
F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi
My BIG-IP is configued with virtual-servers specific to hostname :
VIP-1 handles www.example1.com VIP-2 handles www.example2.com
DNS routes www.example1.com to VIP-1 IP and www.example2.com to VIP-2 IP
For all hostnames, I need to route certain uri-forms to a an alternate traffic-manager ( pool_alt_tm ).
My idea is to create a single iRule and add it to VIP-1 and VIP-2.
Here's my iRule :
when HTTP_REQUEST {
set route_to_alt_tm 0
switch -glob [string tolower [HTTP::uri]] {
"/best-pool*" - "/best-bar*" - "/most-romantic*" {
set route_to_alt_tm 1
}
"/about/termsandconditions.html" - "/about/yourpersonalinfo.html" - "/about/rewards.html" {
set route_to_alt_tm 1
}
}
if {$route_to_alt_tm} {
pool pool_alt_tm
event disable all
}
}
Are there any potential problems with not explicitly checking that request host matches www.example1.com --or-- www.example2.com ?
Any drawbacks to this approach ?