Forum Discussion
Jamesy_105825
Dec 23, 2010Nimbostratus
redirect and sorry server, new to irules
I am trying to write an iRule to redirect to a sorry server where another redirect rule exists. I'm new to irules and I can't seem to wrap my head around the logical flow.
Essentially, I wa...
The_Bhattman
Dec 23, 2010Nimbostratus
Hi Jamesy,
The examples you presented are not redirects, because redirects, specifically HTTP redirects is forcing the client's browser to go to a new link or URL. I think what you are refering to is send then the HTTP request to a specific pool based on certain conditions.
So let's start with following pseudo code
IF POOL A is unavailable {
then go to Pool B
ELSE
Go to POOL A
Now there is a command called active_members (http://devcentral.f5.com/wiki/default.aspx/iRules/active_members.html)
When executed this command returns the number of members in a pool So if all the servers in a pool is unavailable then it should return a zero.
Using one of your examples
when HTTP_REQUEST {
if { [active_members pool1] > 0 } {
if { [HTTP::uri] starts_with "/login-test" } {
pool Pool1
}
} else {
pool sorry_page_pool
}
}
I hope this helps
Bhattman
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