1 、运行
docker run -d \
-v /etc/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg \
--sysctl net.ipv4.ip_unprivileged_port_start=0 \
--name haproxy haproxy:2.8.0-alpine3.18
2 、配置
frontend https_frontend
bind *:443
mode tcp
timeout client 120s
timeout connect 120s
timeout server 120s
tcp-request inspect-delay 5s
tcp-request content accept if { req_ssl_hello_type 1 }
use_backend baidu_backend if { req_ssl_sni -i www.baidu.com }
backend baidu_backend
mode tcp
timeout client 120s
timeout connect 120s
timeout server 120s
server baidu www.baidu.com:443 send-proxy-v2 check ssl verify none
3 、报错信息