Forum Discussion
craig_lee10_177
Nimbostratus
Jan 18, 2013irule 404 page
Hi
I am wondering if someone can point me in the right direction. Basically the below works fine when I try and go to a directory that doesn’t exists
when HTTP_RESPONSE {
i...
nitass
Employee
Jan 18, 2013e.g.
[root@ve11a:Active:Changes Pending] config tmsh
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.20.14:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vlans-disabled
}
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm pool foo
ltm pool foo {
members {
200.200.200.101:80 {
address 200.200.200.101
}
}
}
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_RESPONSE {
if { [HTTP::status] == 404 } {
HTTP::respond 200 content [ifile get maint_html_ifile] noserver "Content-Type" "text/html"
}
}
when HTTP_REQUEST {
switch [HTTP::uri] {
"/f5.gif" { HTTP::respond 200 content [ifile get f5_gif_ifile] noserver "Content-Type" "image/gif" }
}
}
}
original response from pool
[root@ve11a:Active:Changes Pending] config curl -I http://200.200.200.101/something
HTTP/1.1 404 Not Found
Date: Sat, 19 Jan 2013 06:50:00 GMT
Server: Apache/2.2.3 (CentOS)
Content-Type: text/html; charset=iso-8859-1
rewritten response from bigip
[root@ve11a:Active:Changes Pending] config curl -i http://172.28.20.14/something
HTTP/1.0 200 OK
Content-Type: text/html
Connection: Keep-Alive
Content-Length: 97
This is maintenance page.
[root@ve11a:Active:Changes Pending] config curl -I http://172.28.20.14/f5.gif
HTTP/1.0 200 OK
Content-Type: image/gif
Connection: Keep-Alive
Content-Length: 3994
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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