Forum Discussion
Alan_Evans_1020
Nimbostratus
Apr 08, 2009iRule (HTTP) to select pool based on URI then continue using that pool for duration of session
I am working on a HTTP iRule where I want to create an iRule that selects a pool based on an entry URI and then have the HTTP session continue using that pool and redirect the user to a regular URI fo...
hoolio
Cirrostratus
Apr 08, 2009'Persist add' is a generic way to manually insert a persistence record. It doesn't actually include the persistence method.
I think using a cookie per pool would be a good method for this scenario. However, I'm not sure I understand the full scenario. Would a client ever start with a request which is sent to one pool and then during the same browser session make a request which goes to another pool? If so, would you want to remove any previously set cookies, so the client would be sent to the most recently selected pool for requests which don't have a corresponding URI to pool mapping in the class?
I'd think the logic would be something like this:
when HTTP_REQUEST {
If request is to a path which has a corresponding path to pool mapping
Select this pool
Use cookie insert persistence for this pool (persist cookie insert "pool_A_cookie")
Set a variable to track that we're using this pool
Else request is not to a path which has a corresponding path to pool mapping, check for pool cookie
If any pool cookie exists
Select this pool
Use cookie insert persistence for this pool (persist cookie insert "pool_X_cookie")
Set a variable to track that we're using this pool
Else no pool cookie, so take some default action like select default pool, redirect client or send HTTP response?
}
when LB_FAILED {
If pool is down, do something like select default pool, redirect or send HTTP response?
Else if pool is up, reselect a different pool member?
}
when HTTP_RESPONSE {
Expire all the other pool cookies based on the variable which tracks the currently used pool
}
Aaron
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
