pool down redirect problem
...this is my init rule, it has some globals used in the later irule
when RULE_INIT {
sets number of seconds to wait before a maintenance retry
set ::wwwqawait 10
set the protcol to be used for all redirects
set ::wwwqaprot "https://"
set hostname for this virtual
set ::wwwqahost "www.site.com"
set failover directory for this virtual
set ::wwwqafail "/maintenance"
set pool name for this virtual
set ::wwwqapool "Test_POOL"
}
...this is the irule with my problem
when HTTP_REQUEST {
check to make sure connection is secure
if { [TCP::local_port] != 443 }
{
HTTP::redirect $::wwwqaprot[HTTP::host][HTTP::uri]
}
make sure a short host (2-part) is a correct match for our certificate (3-part) *.site.com
such as building up site.com (2-part) to www.site.com (3-part)
if there is no 3rd field at the end, then there's only two at the beginning
if { [string length [getfield [HTTP::host] "." 3]] == 0}
{
HTTP::redirect $::wwwqaprot$::wwwqahost[HTTP::uri]
}
make sure a long host (4-part) is a correct match for our certificate (3-part) *.site.com
such as stripping down www.sub.site.com (4-part) to sub.site.com (3-part)
if there is a 4th field at the end (.com), then there's a 1st something at the beginning (likely www.)
if { [string length [getfield [HTTP::host] "." 4]] > 0}
{
HTTP::redirect $::wwwqaprot[domain [HTTP::host] 3][HTTP::uri]
}
check to see if the URI of the request starts with /maintenance
if { [string tolower [HTTP::uri]] starts_with "$::wwwqafail" } {
HTTP::respond 200 content "\
\ blah, site down \
" noserver "Content-Type" "text/html"
return
}
check to see if the pool is down. if so, redirect to the maintenance page
if { [active_members $::wwwqapool] < 1 }
{
HTTP::redirect $::wwwqaprot$::wwwqahost$::wwwqafail
}
end http request block
}
when HTTP_RESPONSE {
HTTP::header remove Server
}
...ok, when the pool is up, everything works fine, I can even invoke the /maintenance URI and get it to kick over to the site. but when the pool is down it throws this error:
TCL error: wwwqa_20_ssl - Operation not supported. Multiple redirect/respond invocations not allowed (line 52) invoked from within "HTTP::redirect $::wwwqaprot$::wwwqahost$::wwwqafail"
...thanks for any help