V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
dunhanson
V2EX  ›  程序员

haproxy 代理 baidu 报错

  •  
  •   dunhanson · 301 天前 · 792 次点击
    这是一个创建于 301 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    3 条回复    2023-07-01 11:06:27 +08:00
    dunhanson
        1
    dunhanson  
    OP
       301 天前
    curl https://www.baidu.com

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

    curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number
    dunhanson
        2
    dunhanson  
    OP
       301 天前
    haproxy 程序日志是正常的
    --------
    root@debian11:/etc/haproxy# docker logs haproxy
    [NOTICE] (1) : New worker (8) forked
    [NOTICE] (1) : Loading success.
    chinni
        3
    chinni  
       301 天前
    send-proxy-v2 去掉呀
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2957 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:18 · PVG 17:18 · LAX 02:18 · JFK 05:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.