cat /etc/haproxy/haproxy.cfg
global
log 127.0.0.1 local3 warning
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 65535
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
#tune.ssl.default-dh-param 2048
defaults
mode tcp
log global
option tcplog
option dontlognull
option http-server-close
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
frontend site-tcp
mode tcp
bind *:8080
default_backend website
backend website
mode tcp
option tcplog
#option ssl-hello-chk
balance roundrobin
server serverA 192.168.10.10:8080 weight 10 check inter 2s rise 2 fall 3
listen admin_stats
stats enable
bind *:9088
mode http
option httplog
log global
maxconn 10
stats refresh 30s
stats uri /admin
stats realm haproxy
stats auth admin:admin
stats hide-version
stats admin if TRUE
haproxy经典配置
最新推荐文章于 2024-08-11 13:12:43 发布