Forum Discussion
ramki_75145
Nimbostratus
Dec 19, 2007maintenance messages
I'm new to iRules and trying to create iRule for different HTTP status codes and serverdown condition.
I took some of the code from other posts in this form. Here is the iRule i got. I'm getting ...
Colin_Walker_12
Dec 19, 2007Historic F5 Account
Here's a cleaned up version of the same rule. See if this one runs any smoother.
when RULE_INIT {
set error_404 "
Sorry, but the page you requested could not be found.
Please check that the requested page was typed properly and try again."
set Servers_down "
Sorry, Servers are currently down for maintenance. Please check back in 10 minutes."
}
when HTTP_RESPONSE {
if {[active_members [LB::server pool]] == 0} {
HTTP::respond 200 content $::Servers_down
} else {
if { [HTTP::status] == 404 } {
HTTP::respond 200 content $::error_404
} elseif { [HTTP::status] >= 500 } {
HTTP::respond 200 content $::Servers_down
}
}
}Colin
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
