Forum Discussion

Joe_Curl_105786's avatar
Joe_Curl_105786
Icon for Nimbostratus rankNimbostratus
May 09, 2007

HTTP::respond

I am trying to get the F5 to respond back with a site down page when the nodes are down. The iRule I am using is below. Basically I see it log the event, however the browser does not appear to be getting the html script. Thanks in advance for any help.

 

 

Joe

 

 

when HTTP_REQUEST {

 

set cli [IP::remote_addr]

 

}

 

 

when LB_FAILED {

 

HTTP::respond 200 content "Healthcare Payment System

Healthcare Payment System

 

System Unavailable

 

The page you are trying to access is currently unavailable. Please try again later. We apologize for any inconvenience.

 

"

 

log local0. "Client: $cli lbfailed"

 

}

1 Reply

  • I expect you're seeing this error as well in the ltm log file:

    May 10 11:13:25 tmm tmm[19697]: 011f0007:3: http_process_state_header_xfer - Invalid action EV_SINK_HEADER during ST_HTTP_XFER_HEADERS

    Per bl0ndie's post here, this is a bug noted in versions prior to 9.4:

    (Click here)

    It is fixed in 9.4. In the meantime, you can send a redirect using 'HTTP::fallback http://mysorrypage.example.com'.

    Also, you could retry the pool if there are nodes up when LB_FAILED is triggered. I think something like this would work on 9.4 (or substitute HTTP::respond with HTTP::fallback for < 9.4):

    
    when HTTP_REQUEST {
       set retries 0
    }
    when LB_FAILED {
       if {[active_members [LB::server pool]] > 0 && ($retries < 3)}{
          incr retries
          log local0. "Reselecting with active members: [active_members [LB::server pool]] and retries: $retries"
          LB::reselect
       } else {
           no nodes available in pool, so respond back to client with BIG-IP generated content
          log local0. "Client: [IP::client_addr] lbfailed"
          HTTP::respond 200 content "blah"
       }
    }

    Aaron