Forum Discussion
ML_108504
May 11, 2012Nimbostratus
Most efficient way to re-prioritize a virtual server's iRules?
Hi folks,
I'm writing a powershell script to add and remove a maintenance page redirect iRule to the top of a given virtual server's iRule list (TMOS versions 9.4.x and 10.x). Any given virtual se...
ML_108504
Jul 12, 2012Nimbostratus
OK, here is the essence of my outage iRule:
priority 100
when HTTP_REQUEST {
HTTP::redirect "http://www.outagesite.com/dir/sorrypage.html"
event disable
}
And here is the essence of my "day-to-day" iRule that is applied to the virtual servers that I am testing:
when HTTP_REQUEST {
set host "wwwt.testsite.com"
set Dir1 [string tolower [getfield [HTTP::uri] "/" 2]]
set Dir2 [string tolower [getfield [HTTP::uri] "/" 3]]
switch -glob $Dir1 {
"uri_A" -
"uri_B" -
"uri_C" { pool p_test_A_http }
"uri_D" -
"uri_E" { pool p_test_B_http }
"uri_F" {
switch -glob $SCEDir2 {
"uri_X" -
"uri_Y" -
"uri_Z" { pool p_test_X_http }
}
}
default { pool p_test_Z_http }
}
}
When I browse to the redirect URL directly (http://www.outagesite.com/dir/sorrypage.html), the sorry page comes up fine. When I hit a virtual server that has both the outage iRule (priority 100) and the "day-to-day" iRule (assumed priority 500), then I get a 404 not found.
The question: am I correct in assuming that the combination of setting priority 100 to the outage iRule and using event disable in that outage iRule should result in the "day-to-day" iRule not executing for any inbound request? Is there a better way to ensure that the "day-to-day" iRule will not execute when the outage iRule is applied?
Thanks!
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