1

I have HAProy load balancing two Tomcats and using sticky sessions. When server A goes down subsequent requests from the same session are served by B. But, if server A comes up again, additional requests from the same session are routed to A. What I want to do is rewrite the cookie so that after A goes down all requests from the same session are routed to B, even if A comes up again.

httpd with mod_jk has this functionality using JvmRouteBinderValve. Is something similar available for HAProxy?

Johnny
  • 113
  • 1
  • 5
  • https://www.haproxy.com/blog/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/ – c4f4t0r Jun 14 '20 at 21:33
  • That's a general explanation of session stickiness but as far as I can tell it doesn't solve my problem. – Johnny Jun 15 '20 at 06:41
  • is not only general explanation, when ask for help show your config not only description of the issue, thanks :) – c4f4t0r Jun 15 '20 at 10:02

1 Answers1

0

After some experimentation looks like changing configuration from cookie JSESSIONID prefix to cookie SERVERID insert indirect nocache does the trick.

Johnny
  • 113
  • 1
  • 5