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, exactly.
I would want to make sure the request was sent to a new node in the pool, and not the same one.
Is it possible?
Also is it possible to store information in a variable and still have it availiable when the iRule is called again?
For example, if all of the nodes for some reason report as busy(they should never do that unless they are down, but I want to avoid a loop), it doesn't bother with the request anymore and redirects to an unavailable page on another server?
Hopefully this makes sense.
-Brian.
- drteeth_127330Historic F5 AccountThe command
returns the name of the selected pool. The commandLB::server pool
returns the address of the selected pool member.LB::server addr
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" } }
- drteeth_127330Historic F5 AccountI should have pointed out that I'm playing games with the querystring parameters in order to keep the redirect count. If your page actually contains form fields, then you need to take care to use a unique name and search the querystring for it. Additionally, you'll need to add an equal sign after the name. But I think this demonstrates the basic idea.
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