Forum Discussion
Select node based on URI value
Hi Everyone,
I have a HTTPS / SSL web app, the end user is LB across a server farm with persistence, this works fine. It's a kind of remote support application.
When a phone call for remote support comes in, the app support guys fire off a HTTPS / SSL session. This session must connect to the same server the end user is connected to.
Working in the lab:
1. End user request https://server.domain.net/app is LB round robin across 10 servers.
2. App support gets request to help user xxx, we know this user is actually talking with server 7.
3. App support connects to https://server.domain.net/app?server=7.
Under development:
4. F5 iRule needs to read the URI "?sessionServer=7" and direct the entire session to server 7. Needs to be persistent on the destination server until the end user or app support guy drop off.
iRule code:
when HTTP_REQUEST {
log local0. "Http query is [HTTP::uri] "
if {[HTTP::uri] contains "/?server=7" } {
log local0. "*** Request is for server 7 *** "
node 192.168.1.7 80
}
if {[HTTP::uri] contains "/?server=8" } {
log local0. "*** Request is for server 8 *** "
node 192.168.1.8 80
}
}
My question - is there a better way to do this ? I'll need 1 entry per server. Will mangling HTTP_REQUEST based on the URI + a persistence profile always send the traffic to the same place ? My thought is doing this under when LB_SELECTED would be a one time per connect request, and therefore lower overhead than by http::request.
FWIW:
SSL terminates on the F5.
Version is 10.2.0
I'm a complete noobie to F5.
- Chris_MillerAltostratus
I assume these servers all in the same pool? If so, it'd be better to specify a pool member than a node. You can't use [HTTP::uri] from LB_SELECTED so HTTP_REQUEST is a good spot for this.
You'll probably end up with something like this:
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "*/server=7*" { pool poolname member 192.168.1.7 80 } "*/server=8*" { pool poolname member 192.168.1.8 80 } default { pool defaultpool } } }
Will also possibly need OneConnect for this,
- hooleylistCirrostratusHere's an example iRule to do URI based pool member selection with persistence:
Recent Discussions
Related Content
* 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