I am using haproxy as load balancer for 3 application servers and before client traffic reached this load balancer, it will first hit a WAF which the WAF has multiple random distributed IPs. So as the connection renew, the original session could jump to another server due to changes of session cookies which I do not want that to happen.
The WAF vendor had advised me to either set the load-balancer's session Identifier to use X-Real-IP when making session cookies. Or delete IP combination from the identification for making session cookies which I do not know how to do so. Can advise me on this?
Below is my haproxy setting.
frontend http_frontend
bind *:80
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js
use_backend static if url_static
default_backend bk_http
frontend https_frontend
bind *:443
mode tcp
default_backend bk_https
backend static
balance roundrobin
server static 127.0.0.1:4331 check
backend bk_http
mode http
balance roundrobin
stick on src table bk_https
cookie SRVNAME insert
server web1 ip1:80 check cookie SA check
server web2 ip2:80 check cookie SB check
backend bk_https
mode tcp
balance leastconn
stick-table type ip size 2000k expire 30m
stick on src
default-server inter 1s
cookie SRVNAME insert
server web1 ip1:443 check cookie web1
server web2 ip2:443 check cookie web2