Gregory_Gerard_
Jun 18, 2005Nimbostratus
How do I detect if a pool is down in an iRule?
Use Case:
pool is down
Current behavior:
I have an http profile setup that sends back an impersonal redirect to the client.
Desired behavior:
I'd like to have the URI passed to the host that got the redirection.
Why?
I have an SSL VS https://blah.example.com
An iRule looks at the first portion of the URI and decides which pool to send to in a big switch statement:
iRule fragment:
elseif {[HTTP::uri] starts_with "/customer1" } {
pool pool-customer1
}
https://blah.example.com/customer1/rest/of/uri?and=stuff
gets routed to a different pool than
https://blah.example.com/customer2/rest/of/uri?and=stuff
If the pool is down, I'd like to be able to redirect to a system down page and send the original URI so I can log it in our application and periodically retry their original request with a JavaScript timer.
Right now, the redirect is fixed because the profile is shared amongst all customers. Must I create a profile per customer to get this behavior or can I gauge the health of a pool and do a better redirect myself?