宝塔面板实现tls分流

Posted by musk on August 27, 2020

宝塔面板实现tls分流

1.搭建宝塔面板

2.登录面板安装Nginx1.14软件,其他软件随意。

3.添加网站输入已解析的域名,进入 网站-设置-SSL,生成Let’s Encrypt免费证书(邮箱可随意填写)。 4.点击 设置-配置文件 最后一个}前加入如下代码

    location /ray{
proxy_redirect off;
proxy_pass http://127.0.0.1:10000;#10000需要替换为第三步第2步的端口号
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
} 

1.V2Ray官网,可打开参考。使用Linux一键安装脚本

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

2.安装完之后,使用以下命令启动或暂停 V2Ray

systemctl start v2ray

systemctl stop v2ray

systemctl enable v2ray

3.编辑config.json文件

{
  "inbounds": [
    {
      "port": 10000,
      "listen":"127.0.0.1",//只监听 127.0.0.1,避免除本机外的机器探测到开放了 10000 端口
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "b831381d-6324-4d53-ad4f-8cda48b30811",
            "alterId": 0
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
        "path": "/ray"
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}  

删除原内容,并复制上面代码,这就是V2服务端配置。

说明:mux为开启状态。另外,path:/ray可替换成其他任意,如/PPP,/YRF,只需上面几处代码统一填写即可。客户端加密推荐使用aes-128-gcm了

如有任何知识产权、版权问题或理论错误,还请指正。

转载请注明原作者及以上信息。