Forum Discussion

Leo's avatar
Leo
Icon for Nimbostratus rankNimbostratus
Apr 14, 2013

adding headers to HTTP::respond content

Hello all,

 

I'm using an iRule to respond a 503 page when my pool members are down. The iRule works fine, but the developers asked to add the "retry-after" header to the response.

 

The iRule looks like this:

 

 

when HTTP_REQUEST {

 

if { [active_members IIS-pool-new] < 1 } {

 

if { [HTTP::uri] eq "/503.jpg" } {

 

HTTP::respond 200 content [ifile get 503]

 

} else {

 

log local0.alert "***no pool members available in pool: iis-pool-new! redirected to 503 page***"

 

HTTP::respond 503 content "[html code - the forum doesn't display it correctly...]"

 

}

 

}

 

}

 

 

 

 

I've googled and found the following command:

 

HTTP::respond 503 Retry-After 10800

 

But how do I integrate that into my iRule? won't the first respond just end the iRule?

 

1 Reply

  • John_Alam_45640's avatar
    John_Alam_45640
    Historic F5 Account
    It sounds like you just need to add a header to the same response:

     

    HTTP::respond 503 content "[html code - the forum doesn't display it correctly...]" Retry-After 10800

     

     

    Look here for more:

     

    https://devcentral.f5.com/wiki/iRules.HTTP__respond.ashx