V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
dunhanson
V2EX  ›  程序员

haproxy 代理 baidu 报错

  •  
  •   dunhanson · Jun 30, 2023 · 1407 views
    This topic created in 1031 days ago, the information mentioned may be changed or developed.

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

    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 replies    2023-07-01 11:06:27 +08:00
    dunhanson
        1
    dunhanson  
    OP
       Jun 30, 2023
    curl https://www.baidu.com

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

    curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number
    dunhanson
        2
    dunhanson  
    OP
       Jun 30, 2023
    haproxy 程序日志是正常的
    --------
    root@debian11:/etc/haproxy# docker logs haproxy
    [NOTICE] (1) : New worker (8) forked
    [NOTICE] (1) : Loading success.
    chinni
        3
    chinni  
       Jul 1, 2023
    send-proxy-v2 去掉呀
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4715 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 10:06 · PVG 18:06 · LAX 03:06 · JFK 06:06
    ♥ Do have faith in what you're doing.