为什么代理百度?哈哈测试而已,真实肯定不会代理百度。
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 、报错信息
1
dunhanson OP curl https://www.baidu.com
目前可以了,但是本地测试报错 curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number |
2
dunhanson OP haproxy 程序日志是正常的
-------- root@debian11:/etc/haproxy# docker logs haproxy [NOTICE] (1) : New worker (8) forked [NOTICE] (1) : Loading success. |
3
chinni 2023-07-01 11:06:27 +08:00
send-proxy-v2 去掉呀
|