在我的环境中,我有2个Web服务器(Apache)的haproxy负载平衡,这是我的HA代理配置:
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
tune.ssl.default-dh-param 2048
daemon
nbproc 1
stats socket /var/lib/haproxy/stats
stats timeout 1m
nogetaddrinfo
listen front
bind :80
redirect scheme https if { hdr(Host) -i domain.com } !{ ssl_fc }
listen front_ssl
bind :443 ssl crt /opt/certificate/domain.pem
mode http
option dontlognull
stats enable
stats uri /ha?stats
stats realm system
stats auth root:*********
stats refresh 5s
option http-keep-alive
option forwardfor
option redispatch
reqadd X-Forwarded-Proto:\ https if { ssl_fc …Run Code Online (Sandbox Code Playgroud)