Here's an example of what I was thinking. It uses a session cookie to track whether an initial pool selection has been made. Once a pool has been selected, a separate session cookie is used for persistence within the pool.
Make sure to test with a OneConnect profile enabled on the virtual server. If you're using serverside source address translation, you can use the default OneConnect profile with a /0 source mask. Else, use a custom OneConnect profile with a /32 source mask.
when HTTP_REQUEST {
Track whether to insert the pool selector cookie
set insert_cookie 0
Check if there is a pool selector cookie
switch [HTTP::cookie value pool_selector] {
1 {
client already made a request so select the first pool
pool wdc-wshwstst-5001
Use cookie insert persistence to ensure client is persisted to same member within this pool
persist cookie insert pool5001 0
}
2 {
client already made a request so select the second pool
pool wdc-wshwstst-5002
Use cookie insert persistence to ensure client is persisted to same member within this pool
persist cookie insert pool5002 0
}
default {
No cookie, so check the URI
switch [HTTP::uri] {
"/" { HTTP::redirect "https://[HTTP::host]/tf/WalletShare" }
"/tf/WalletShareREIT" {
pool wdc-wshwstst-5002
set insert_cookie 2
persist cookie insert pool5002 0
}
"/tf/WalletShare" {
pool wdc-wshwstst-5001
set insert_cookie 1
persist cookie insert pool5002 0
}
}
}
}
}
when HTTP_RESPONSE {
Check if we've made an initial pool selection for this request
switch $insert_cookie {
1 -
2 {
Insert the cookie in the response
HTTP::cookie insert name pool_selector value $insert_cookie path /
}
}
}
Aaron