Forum Discussion
redirect not working
redirect is working as expected but when both pools are down i dont see traffic going to HTTP::respond 503 content [ifile get "applicationdown.html"] . I get connection reset can't reach the page.
when HTTP_REQUEST priority 500 {
if { [HTTP::uri] == "/" } {
HTTP::redirect "https://[HTTP::host]/testpage"
}
if { [active_members pool1] == 0 }{
if { ( ( [class match [IP::client_addr] eq "whitelist"] ) && ( [active_members pool2 ] > 0 ) ) }
{ pool pool2
}
else {
log local0. "applicationdown"
HTTP::respond 503 content [ifile get "applicationdown.html"]
}
}
}
lb err tmm[31148]: 01220001:3: TCL error: /Common/applicationdown-irule <HTTP_REQUEST> - Operation not supported. Multiple redirect/respond invocations not allowed (line 1) invoked from within "HTTP::respond 503 content [ifile get "applicationdown.html"]"
lb err tmm[31148]: 01220001:3: TCL error: /Common/applicationdown-irule <HTTP_REQUEST> - Operation not supported. Multiple redirect/respond invocations not allowed (line 10) invoked from within "HTTP::respond 503 content [ifile get "applicationdown.html"]"
In the iRule you posted it seems you have a few syntax issues. Try copying the following iRule and see if your issue is resolved.
when HTTP_REQUEST priority 500 {
if { [HTTP::uri] == "/" } {
HTTP::redirect "https://[HTTP::host]/testpage"
}
if { [active_members pool1] == 0 } {
if { ( ( [class -- match [IP::client_addr] == "whitelist"] ) && ( [active_members pool2 ] > 0 ) ) } {
pool pool2
} else {
log local0. "applicationdown"
HTTP::respond 503 content [ifile get "applicationdown.html"]
}
}
}
- sandikskMay 09, 2024
Nimbostratus
Paulius , thankyou so much for looking into this , but the problem with the above logic is when both the pools are down users still need to get the maintenance page but when i try accessing the url abc.test.com -- I get connection rest page cannot be displayed when i access https://abc.test.com/testpage --- it displays me the application down message from the log statement . Dont see any issues with the syntax of the above irule but when both pools are down i see vip is marked down so the else statment is not getting executed i guess.
tmm[31148]: 01220001:3: TCL error: /Common/test-irule <HTTP_REQUEST> - Operation not supported. Multiple redirect/respond invocations not allowed (line 10) invoked from within "HTTP::respond 503 content [ifile get "applicationdown.html"]"
- PauliusMay 09, 2024
MVP
It seems that something could be wrong with the iFile possibly. If you can provide me the contents of the iFile I might be able to test this in my lab and see if I can get it to work.
- sandikskMay 10, 2024
Nimbostratus
sent an email with the details ,redirect to maintenance is not needed we need logic only when both the pools are down route the traffic to point to ifile without any uri redirect.
We need uri redirect for the default pool 1, when pool1 is down and traffic is fwded to pool2 based on the condition . In all these scenarios i need HTTP::redirect.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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