Hello. I would like to ask if it is possible to stick to individual server based on url_param?
I have HAProxy load balancer and couple of proxies as a backend. I would like to stick to one of the backend proxies if the url_param is matching with one stored in stick table.
I have config file:
frontend testfrontend
bind IP:PORT
default_backend proxies
backend proxies
stick-table type string size 1m expire 1h
stick on url_param(session_id) table proxies
stick store-request url_param(session_id) table proxies
http-request set-uri '%[url,regsub("^(.*)(&|\?)session_id[^&]*(?:&|$)(.*)",\1\2\3)]'
# Hosts
server host1 IP:PORT check
server host2 IP:PORT check
server host3 IP:PORT check
server host4 IP:PORT check
It should now stick to session on matching url param but it doesn’t and instead it is cycling through proxies.