跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 一个nat端口利用haproxy中转多个服务.
未分類
20 2 月 2020

一个nat端口利用haproxy中转多个服务.

wgetrc 大佬有话说 :

一个nat端口利用haproxy中转多个服务.

本帖最后由 wgetrc 于 2020-2-20 10:36 编辑

haproxy 根据域名分流 配置如下:
nat小鸡 -> haproxy Sever –> 443 {v2*y s* tr*jan ssh}

global
      log /dev/log local0
      log /dev/log local1 notice
      chroot /var/lib/haproxy
      user haproxy
      group haproxy
      daemon

defaults
      log global
      mode tcp
      option tcplog
      option dontlognull
      #maxconn 2000
      timeout connect 24h
      timeout client 24h
      timeout server 24h

frontend ssl
      mode tcp
      bind *:443
      tcp-request inspect-delay 5s
      tcp-request content accept if { req.ssl_hello_type 1 }

      #acl ssh_payload payload(0,7) -m bin 5353482d322e30
      acl v2-pr req_ssl_sni -i pr.v2ray.best
      acl v2-gcpreq_ssl_sni -i pr.v2ray.best
      acl v2-trreq_ssl_sni -i pr.trojan.best
      acl ss-gcpreq_ssl_sni -i gcp.ss.best

      use_backend gcp if v2-gcp
      use_backend pr if v2-pr
      use_backend tr if v2-tr
      #use_backend shadowsocks if ss-gcp
      use_backend defaultserv if { req.ssl_hello_type 1 } !v2-gcp !v2-tr !v2-pr !ss-gcp

backend gcp
    mode tcp
    option ssl-hello-chk
    server server1 xxx.xxx.xxx.xxx:443

backend tr
    mode tcp
    option ssl-hello-chk
    http-request set-header Host pr.trojan.best
    #option httpclose
    server server1 xxx.xxx.xxx.xxx:4431

backend pr
    mode tcp
    option ssl-hello-chk
    server server1 xxx.xxx.xxx.xxx:443
backend defaultserv
        mode tcp
        server server1 www.baidu.com

重点:trojan 域名 需要手动 指hosts,v2ray则直接http伪装填写域名.

请叫我毛线 大佬有话说 :

感谢楼主分享,如果只是中转http和https的话,直接用caddy或者nginx反代会简单一点,haproxy的话功能强大多,但是那配置对于大部分人来说也是真的麻烦

Lebron 大佬有话说 :

习惯用iptable了

logo 大佬有话说 :

像这种教程贴 都是要mark一下的

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具