Hi,
I’ve followed the guide at https://www.haproxy.com/blog/haproxy-on-docker-swarm-load-balancing-and-dns-service-discovery/ to setup a haproxy to load balance docker swarm backend services which works well.
I would like to introduce sticky sessions and found the dynamic cookie configuration at https://www.haproxy.com/de/blog/whats-new-haproxy-1-8/ which allows me to use
dynamic-cookie-key MYKEY
cookie SRVID insert dynamic
in this context.
Now to my question: is it possible to setup this kind of session persistence for the usage with application session cookies, like explained in this guide: https://www.haproxy.com/blog/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/
I’m searching for a way to configure a combination of
dynamic-cookie-key MYKEY
cookie SRVID insert dynamic
server-template server-template myapp- 3 myapp-Service:80 check resolvers docker init-addr libc,none
with
cookie JSESSIONID prefix nocache
server s1 192.168.10.11:80 check cookie s1
server s2 192.168.10.21:80 check cookie s2
Any hint very appreciated,
Br,
Klaus