Aflex logic not taking precedence over session persit cookie

jpostjpost Member
Hi,
We have an aflex rule that redirects requests based on the url. There is also a persistence cookie set. The issue is when the url switches, the aflex logic should send the request to a new server pool, but the cookie appears to be taking precedence and forcing the request back to the original server the user was sent to. How do we get the aflex logic to determine the correct pool, and then if there is a persistence cookie for a server in that pool, use the cookie.
Current Aflex rule:

when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
if { ($host equals "www.example.com") } then {
if { ([HTTP::uri] equals "/index.htm") or ([HTTP::uri] equals "/") or ([HTTP::uri] starts_with "/TMS/") or ($uri starts_with "/options") } then {
pool prod-example-com-pool2
} else {
pool prod-example-com
}
} else {
HTTP::redirect https://www.afford.com[HTTP::uri]
}
}
Tagged:

Comments

  • jserranojserrano Member ✭✭

    Hi,

    Cookie persintance template, by default, is preceding aflex LB decision for efficiency purposes. When using along with any url switching logic (via aflex or http template) you should always use "match-type=service-group" option under cookie persistance template, this way persistance lookup happens once Service Group is selected and not before.

    !

    slb template persist cookie TestCookiePers

     match-type service-group

    !

    Regards

Sign In or Register to comment.