Forum Discussion
Matthew_Ross_71
Nimbostratus
May 26, 2005Capture a 4xx or 5xx status code...
All,
I am trying to catch a 404 or 401 or 500 http status code in my BIG-IP. I am having difficulty getting the rule to work. I started by using chapter 5, specifically pages 5-1 through 5-40 or so, to help out.
I found the http_header() function and thought that http_header("status") or http_header("status_code") and even http_header("statuscode") contains "404" would get what I wanted. This does not work.
I looked around some of these posts and saw a HTTP_Request type thing...I did not see this in my book.
I am running 4.5.10 build 84. Here is my current (non-working) rule:
if (http_header("status") == "404") {
redirect to "http://172.30.103.13:50123/customunavail.html"
}
else {
use pool myprodpool
}
- Scott_Tennican_Historic F5 AccountSorry, V4.X iRules do not parse HTTP server responses. Note that table 5.4 is named "HTTP request string variables". You will have to upgrade to V9 to be able to create iRules based on the server response. However, you can redirect when the members of a pool go down. See Chapter 4 "Redirecting HTTP Requests" to read about it. If you aren't ready to move to V9, I would recommend upgrading to V4.5.13 to improve the reliability and security of your BIG-IP.
- Matthew_Ross_71
Nimbostratus
Gumby, - Scott_Tennican_Historic F5 AccountNo problem Matt.
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