Forum Discussion

Peter_Degrassi_'s avatar
Peter_Degrassi_
Historic F5 Account
Dec 08, 2006

HTTP redirect with monitor

Hi,

 

 

I have an IRule that redirects HTTP requests based on the source IP of the request. I'd like to add a check to ensure that the re-direct site is up before redirecting. I'm considering using "LB::status" for this but I'm not sure where to insert it into the rule. Here's my current rule...

 

 

when HTTP_REQUEST {

 

if { [IP::addr [IP::client_addr] equals 10.1.3.0/255.255.255.0] } {

 

HTTP::redirect "http://10.1.4.11/"

 

}

 

}

 

 

So I want the redirection to occur only if the client address matches AND the site at 10.1.4.11 is up. Of course I would have to put the server in a pool and assign a monitor.

 

 

Any pointers?

 

 

Thanks

3 Replies

  • Hello,

     

     

    If you define the host that you want to redirect to in a pool and assign a monitor to check the state of the host, you could then use LB::status to verify the host is up before issuing the redirect. Check the LB::status page for details/examples (Click here).

     

     

    The LB::status function was added in 9.2 and late in 9.1.2, I think.

     

     

    Aaron
  • Peter_Degrassi_'s avatar
    Peter_Degrassi_
    Historic F5 Account
    I can't seem to get the syntax correct. How should I construct the iRule? Where do I put the LB::status check so it performs a logical AND with the client IP check? I'm a newb so dumb it down as much as possible. :-)

     

     

    Thanks