HAProxy基于cookie实现客户端会话保持

缓存功能

1
2
3
4
5
6
7
8
9
10
[root@CentOS7-2 ~]#vim /etc/haproxy/haproxy.cfg
listen web1
mode http
bind 192.168.36.104:80
option forwardfor
cookie SERVER-COOKIE insert indirect nocache
server web1 192.168.36.110:80 cookie web-110 weight 1 check inter 3000 fall 3 rise 5
server web2 192.168.36.106:80 cookie web-106 weight 1 check inter 3000 fall 3 rise 5

[root@CentOS7-2 ~]#systemctl restart haproxy.service