Forum Discussion
Don_22992
Nimbostratus
Apr 02, 2008stubborn 4xx/5xx Error Handler
I am sure this is simple....
I have the following iRule to redirect 4xx & 5xx errors to a page on a backend server. It works great - once I have sucessfully connected to the site once! What ...
hoolio
Cirrostratus
Apr 09, 2008In previous versions of BIG-IP ASM, you'd need to disable ASM when sending a response from an iRule (Click here). I didn't think that would be necessary in 9.4.2+ with the plugin architecture. Can you open a case with F5 Support asking them to investigate this? If you want to try one more thing, you could explicitly disable the ASM plugin when sending a redirect:
when HTTP_REQUEST {
set myhost [HTTP::host]
}
when HTTP_RESPONSE {
Initialise a variable to track whether we're redirecting this request
set redirect 0
log local0. "[IP::client_addr]:[TCP::client_port]: Request $myhost generated response status: [HTTP::status]"
if { ([HTTP::status] starts_with "4")} {
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to 4xx.htm"
HTTP::redirect https://$myhost/images/errors/err_4xx.htm
set redirect 1
} elseif { ([HTTP::status] starts_with "5")} {
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to 5xx.htm"
HTTP::redirect https://$myhost/images/errors/err_5xx.htm
set redirect 1
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: Doing nothing"
}
}
when HTTP_CLASS_SELECTED {
If the request is being redirected, disable ASM
if {$redirect}{
Enable ASM by default
PLUGIN::disable ASM
} else {
Enable ASM by default
PLUGIN::enable ASM
}
}Aaron
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
