Forum Discussion
jokragly
Nimbostratus
Jul 22, 2016iRule for sorry page with pool and path
So I have an iRule that identifies if the LB server pool is equal to 0 then call a different pool which is the server hosting the Sorry Page. The issue is the Sorry page is not at the root of this p...
Jul 22, 2016
Silly me. Freestyling iRules is not working out so good it seems. Try this?
when LB_FAILED {
LB failed is triggered when the load balancer
is unable to choose a member for the connection (no available
members, or too many retries due to server connection issues
Set the variable failed to 1 so we can check it later in the response
set failed 1
If the client does not request resources in the maintenance
folder, then rewrite the uri. Otherwise, let it pass through as the
content reqests belongs to the maintenance page
if { !([HTTP::uri starts_with "/maintenance/") } {
HTTP::uri "/maintenance/maintenance.html"
}
Select the pool you want to serve the maintenance page
pool mov_maintenance_page
}
when HTTP_RESPONSE {
Check if the LB failed event has been triggered by checking if
the variable failed exists and is set to 1
if { [info exists failed] && $failed == 1 } {
Close the connection to make sure that the user makes a new connection
HTTP::close
}
}
/Patrik
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