HAProxy配置文件
HAProxy配置文件
global
log 127.0.0.1 local2 info
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 20480
nbproc 8
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
stats refresh 30s
stats realm Welcome Login Haproxy\ Statistics
stats uri /haproxy-admin
stats auth admin:admin~!@
stats hide-version
stats admin if TRUE
frontend Web_Service
bind *:80
mode http
log global
option httplog
option forwardfor
option httpclose
option logasap
option dontlognull
#capture request header Host len 20
#copture request header Referer len 20
default_backend web
backend web
mode http
option redispatch
option abortonclose
balance source
cookie SERVERID
#option httpchk GET /index.html
server web1 192.168.199.203:80 cookie server1 weight 1 check inter 2000 rise 2 fall 3
server web2 192.168.199.204:80 cookie server2 weight 1 check inter 2000 rise 2 fall 3
作者:wanghongwei
版权声明:本作品遵循<CC BY-NC-ND 4.0>版权协议,商业转载请联系作者获得授权,非商业转载请附上原文出处链接及本声明。