haproxy 代理 baidu 报错

313 天前
 dunhanson

为什么代理百度?哈哈测试而已,真实肯定不会代理百度。

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 、报错信息

810 次点击
所在节点    程序员
3 条回复
dunhanson
313 天前
curl https://www.baidu.com

目前可以了,但是本地测试报错

curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number
dunhanson
313 天前
haproxy 程序日志是正常的
--------
root@debian11:/etc/haproxy# docker logs haproxy
[NOTICE] (1) : New worker (8) forked
[NOTICE] (1) : Loading success.
chinni
313 天前
send-proxy-v2 去掉呀

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/953140

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX