#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
debug
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
tune.ssl.default-dh-param 2048
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
defaults
log global
option httplog
option dontlognull
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
option redispatch
retries 3
option httpchk GET /
default-server inter 3s fall 3 rise 2
frontend https-in
bind *:443 ssl crt /etc/haproxy/certs/abc.com.pem
mode http
option httplog
default_backend https-backend
backend https-backend
mode http
balance roundrobin
option httpchk GET /
server node1 1.1.1.1:3311 check
server node2 2.2.2.2:443 ssl verify none check
server node3 3.3.3.3:443 ssl verify none check
# 统计页面配置
listen stats
bind *:8686
mode http
stats enable
stats uri /haproxy?stats
stats refresh 10s
stats realm HAProxy\ Statistics
stats auth admin:admin # 设置用户名和密码
stats admin if LOCALHOST # 本地可以进行管理操作