haproxy 安装
globallog 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
chroot /usr/local/haproxy
uid 99
gid 99
daemon
#debug
#quiet
defaults
log global
mode http
optionhttplog
optiondontlognull
retries 3
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listenhttpsvc 192.168.1.34:8090 把80 80端口转到8090端口
optionhttpchk
balance roundrobin
cookieSERVERID insert indirect nocache
serverinst1 192.168.1.253:80 cookie server01 check inter 2000 fall 3
serverinst2 192.168.1.254:80 cookie server02 check inter 2000 fall 3
capture cookie vgnvisitor= len 32
optionhttpclose # disable keep-alive
rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address
页:
[1]