Mar 27, 2026 - For details about updated CVE-2025-53521 (BIG-IP APM vulnerability), refer to K000156741.

Forum Discussion

Shahram_83722's avatar
Shahram_83722
Icon for Nimbostratus rankNimbostratus
Jun 15, 2012

iRule to redirect based on path plus fallback host

I'm not super on iRules but need to write one that will redirect path A and B to pool1 and path C and D to pool2. I also need to incorporate a fallback host in case each of these pools don't have a member. I've come up with the following iRule. Can anyone tell me whether or not this is a sound iRule or if there is anything better I should write?

 

 

 

 

when HTTP_REQUEST {

 

 

switch -glob -- [string tolower [HTTP::path]] {

 

 

 

"/a*" -

 

"/b*" {

 

if {[active_members pool_1] < 1} {

 

Log and direct the client to Maintenance pool

 

log local0. "!!Maintenance page called for Pool1!!"

 

pool Fallback_Pool }

 

else {

 

pool pool_1

 

}

 

 

 

"/c*" -

 

"/d*" {

 

if {[active_members pool_2] < 1} {

 

Log and direct the client to Maintenance pool

 

log local0. "!!Maintenance page called for Pool2!!"

 

pool Fallback_Pool }

 

else {

 

pool pool_2

 

}

 

 

default { discard }

 

 

 

}

 

}

 

 

 

 

7 Replies

No RepliesBe the first to reply