Forum Discussion
Brian_Ott_11267
Nimbostratus
Dec 07, 2004Redirecting to the same pool, different node
Is there a builtin variable that stores the pool the request is going to?
I need to redirect the request to another node in the same pool. But I don't know how to have it do that, exact...
drteeth_127330
Dec 23, 2004Historic F5 Account
The command
LB::server pool returns the name of the selected pool. The command LB::server addr returns the address of the selected pool member.
I recommend a different approach to what I think you are trying to accomplish. Rather than avoid the same node when redirecting, why not just add a limit of no more than n redirects? It is unlikely that your LB mode will choose the same node n times in a row, and if the failure is more than intermittent, the service checks should mark the node down. Here is a rule that redirects up to 4 times when a server error occurs:
when HTTP_REQUEST {
set http_path [HTTP::path]
set http_query [HTTP::query]
}
when HTTP_RESPONSE {
if {([HTTP::status] >= 500) && ([string length $http_query] < 3)} {
HTTP::redirect "${http_path}?${http_query}x"
}
}
Finally, in order to redirect to an unavailable page when all the pool members are down, you should configure a fallback host with the fallback http profile option.
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
