Hey Guys,
I’ve spent a bit of time trying to figure out how to build an i-Rule that will respond in a manner that we would like. The gist of it is that we would like to add the retry-after (set to 10800) and set the connection to close.
I’ve read through a handful of articles, including DevCentral, which discusses a similar concept. I’ve attempted every option they’ve discussed there with no positive results.
Here’s the gist of our i-Rule (note, there’s a section I’ve not copied in which is basically the creation of a variable called maintenance_msg, which is just the HTML for the page).
Original i-Rule:
when HTTP_REQUEST {
if {[active_members [LB::server pool]] == 0 || [HTTP::uri] == “/maintenance.htm”}{
if {$::debug}{log local0. “Displaying maintence page.”}
HTTP::respond 503 content $::maintenance_msg
}
}
Attempted to modify it and add the Retry-After: 10800 (also Retry-After 10800). Results showed no difference in the header, and the page still worked just fine.
when HTTP_REQUEST {
if {[active_members [LB::server pool]] == 0 || [HTTP::uri] == “/maintenance.htm”}{
if {$::debug}{log local0. “Displaying maintence page.”}
HTTP::respond 503 Retry-After: 10800 content $::maintenance_msg
}
}
I attempted to add HTTP::header replace Retry-After 10800 as a separate line pre and post the HTTP::respond. Post responded as above, while pre broke the web page.
The very end of that link above discusses having an HTTP_REQUEST_SEND, SERVER_DATA, and HTTP_RESPONSE. This gave the same results as above where the page broke.
When the page broke, I loaded up Fiddler to see what was going on (which is also what I was using to view the response header). I ended up getting this error:
“The server did not return properly formatted HTTP Headers. HTTP headers should be terminated with CRLFCRLF. These were terminated with LFLF.”
Based on this, I need to add some carriage returns to my header, but I’m not certain how to do that. Also, I expect that once I get the Retry-After function to work, simply adding the Connection function will work in an identical manner, so I’ve not tinkered with it yet.
Thanks!