Forum Discussion
Brad_Otlin
Nov 02, 2011Ret. Employee
http::status 404 will NOT process http::respond 200
I have this iRule to check for 404s from the servers and reply to client with some simple html maint page. However, when a user requests a page that is not on the server, they just get the standard ...
nitass
Nov 02, 2011Employee
this is mine.
[root@iris:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.17.33:http
ip protocol tcp
rules myrule
profiles {
http {}
tcp {}
}
}
[root@iris:Active] config b pool foo list
pool foo {
members 10.10.70.110:http {}
}
[root@iris:Active] config b rule myrule list
rule myrule {
when HTTP_RESPONSE {
if { [HTTP::status] == 404 } {
HTTP::respond 200 content "maintenance pageSite is Currently Unavailable"
}
}
}
curl -i http://172.28.17.33/notreal
HTTP/1.0 200 OK
Server: BigIP
Connection: Keep-Alive
Content-Length: 84
maintenance pageSite is Currently Unavailable
[root@iris:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.17.20(38858) <-> 172.28.17.33(80)
1320255154.0773 (0.0011) C>S
---------------------------------------------------------------
GET /notreal HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.17.33
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 10.10.72.30(38858) <-> 10.10.70.110(80)
1320255154.0776 (0.0003) C>S
---------------------------------------------------------------
GET /notreal HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.17.33
Accept: */*
---------------------------------------------------------------
1320255154.0795 (0.0018) S>C
---------------------------------------------------------------
HTTP/1.1 404 Not Found
Date: Wed, 02 Nov 2011 08:42:45 GMT
Server: Apache/2.0.59 (rPath)
Vary: Accept-Encoding
Content-Length: 282
Content-Type: text/html; charset=iso-8859-1
404 Not Found
Not Found
The requested URL /notreal was not found on this server.
Apache/2.0.59 (rPath) Server at 172.28.17.33 Port 80
---------------------------------------------------------------
1320255154.0796 (0.0023) S>C
---------------------------------------------------------------
HTTP/1.0 200 OK
Server: BigIP
Connection: Keep-Alive
Content-Length: 84
maintenance pageSite is Currently Unavailable
---------------------------------------------------------------
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