Forum Discussion
AdamFoot_1451
Nimbostratus
May 16, 2008Cookie and URI Decisions
Hi all,
Could someone just check this over for me please.The goal is to add some
persistence based on version cookie,so we can direct version specific traffic to specific pools.
...
hoolio
Cirrostratus
May 20, 2008Hi Adam,
The square braces execute the return value of the pool command. If you remove them from the snatpool and pool commands the syntax error should be resolved.
Also, LB::server pool will return the name of the currently selected pool. If the first request is to the upload page, the currently selected pool will be AVG1. If there is another HTTP request on the same TCP connection, the currently selected pool will still be set to the AVG1 pool. If you save the LB::server pool value at the beginning of the connection it will be the default pool configured on the VIP.
Lastly, it would be more exact to check if the HTTP::path is/ends with "/attachmentshare/upload.aspx". The URI includes the query string (anything the question mark in the URI) whereas the path doesn't.
How about this?
when CLIENT_ACCEPTED {
Save the name of the default pool of the VIP
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
log local0.info "URL is [HTTP::host][HTTP::uri], VIP is [IP::local_addr]:[TCP::local_port] URI is [HTTP::uri]"
If Attachment URI exists
if {[string tolower [HTTP::path]] ends_with "/attachmentshare/upload.aspx"}{
snatpool SNAT_10.10.10.10
pool AVG1
log local0. "sending user to attachment pool AVG1 SNAT_20.146.203.122"
} else {
log local0.info "sending user to default pool $default_pool"
pool default_pool
}
}
This is based off of your most recent rule. However, it looks like you removed any logic regarding cookies. Do you not need to account for users who do/don't have a specific cookie?
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
