Forum Discussion

zacks023_101602's avatar
zacks023_101602
Icon for Nimbostratus rankNimbostratus
Oct 16, 2009

Redirect

I am wondering if we can adjust the rules, to not redirect any request which contains the following URI "/xyz/localservices"

 

 

Current working iRule:

 

 

when LB_FAILED {

 

 

if { [active_members [LB::server pool]] != 0 } {

 

 

} else {

 

 

HTTP::fallback "http://xyz.testabc.cgi.com"

 

 

}

 

 

}

2 Replies

  • I believe you can do the following

     
     when LB_FAILED { 
        if { [active_members [LB::server pool]] != 0 } { 
        } else { 
        if {![HTTP::uri] eq "/xyz/localservice" } { 
           HTTP::fallback "http://xyz.testabc.cgi.com" 
        } 
     } 
     

    I hope this helps

    CB
  • I don't think HTTP::uri or other HTTP request details are available in the LB_FAILED event. You could save the URI value in HTTP_REQUEST and then check it in LB_FAILED. Also, you can remove the double negative in the logic using something like this:

     
     when HTTP_REQUEST { 
      
         Save the URI to check in LB_FAILED 
        set uri [HTTP::uri] 
     } 
     when LB_FAILED { 
        if { [active_members [LB::server pool]] == 0 and not ($uri contains "/xyz/localservice")} { 
           HTTP::fallback "http://xyz.testabc.cgi.com" 
        } 
     } 
     

    Aaron