Forum Discussion
error code 503 redirect irule
- Jan 08, 2026
Injeyan, thanks for reaching out with your help. I wanted to share that we got this to work and I wanted to show how.
I applied this i-rule intially;
when HTTP_REQUEST {
if { [HTTP::uri] contains "/pssmetrics" }{
pool web-lb-dev-f5-ssl-pool2
} else {
pool web-lb-dev-f5-ssl-pool
}
}
That specifies I want that uri to go to pool2. In pool 2 I have server 1 and server 2. Pool (1) only has server 1. Within pool2, I have a custom healh monitor, and when you mentioned a health monitor, that got me thinking along that track. Within the custom monitor, the pool member with the active service for pssmetrics will get the traffic load balanced to it, the condition being anytime there is a 503 error code.
So as follows;
Send String:
GET /pssmetrics HTTP/1.1\r\nHost: webfrontendalias.domain.org\r\nConnection: Close\r\n\r\n
Receive String:
302
(No OK after this, the regex gets cranky)
Receive Disable Strng:
503
Hi,
i am also suggest the same method
when HTTP_REQUEST {
if { [active_members pool_primary] > 0 } {
pool pool_primary
} elseif { [active_members pool_secondary] > 0 } {
pool pool_secondary
} else {
HTTP::respond 503 content "Service Unavailable"
}
}
BR
Aswin
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