宝塔面板实现 tls 分流
- 搭建宝塔面板
- 登录面板安装 Nginx 1.14 软件,其他软件随意
- 添加网站输入已解析的域名,进入 网站 → 设置 → SSL,生成 Let’s Encrypt 免费证书(邮箱可随意填写)
- 点击 设置 → 配置文件,在最后一个
}前加入如下代码
location /ray {
proxy_redirect off;
proxy_pass http://127.0.0.1:10000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
- 安装 V2Ray。使用 Linux 一键安装脚本
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
- 安装完之后,使用以下命令启动或暂停 V2Ray
systemctl start v2ray
systemctl stop v2ray
systemctl enable v2ray
- 编辑 config.json 文件
{
"inbounds": [
{
"port": 10000,
"listen": "127.0.0.1",
"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。
如有任何知识产权、版权问题或理论错误,还请指正。
转载请注明原作者及以上信息。