Forum Discussion
Jay_Guerette
Nimbostratus
Aug 29, 2007HTTP 100 causes this rule to hang the connection
Using BIG-IP 9.2.5 Build 5.1; I have a legacy HTTP application that will throw an error with an 'HTTP 200' result code. I want to intercept this error, and display a friendly error page. In order to d...
Aug 29, 2007
It's hard to guess what's going wrong. If the server is sending a 100 response code, then the iRule should not pass the first if in the HTTP_RESPONSE event and ignore the rest. I'd try to throw in some logging and see what shows up on the /var/log/ltm log file.
when HTTP_RESPONSE {
set status [getfield [HTTP::status] " " 1]
log local0. "HTTP Status: $status"
if { [HTTP::header "Content-Type"] contains "text/html" && $status == 200 } {
log local0. "Collecting [HTTP::header Content-Length]..."
HTTP::collect [HTTP::header Content-Length]
}
}
when HTTP_RESPONSE_DATA {
if { [HTTP::payload] contains "Application Error" } {
log local0. "HTTP::payload contains Application Error - sending 302 response"
HTTP::respond 302 Location "/error/"
}
}
I'm wondering why you are doing a getfield on the HTTP::status. Are you finding that it is containing more than just the numeric status code?
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects