status
Published
date
Feb 13, 2021
slug
btvless
summary
category
技术分享
tags
科学上网
安装宝塔面板
打开宝塔官网,有安装教程。
新建站点
- 宝塔面板安装好之后,安装好nginx、php等运行环境。
- 新建站点,绑定域名,解析域名不要多说。
- 编辑配置文件,将下方代码复制到最后一行之上。
location /字符串随便写/ {
if ($http_upgrade != "websocket") {
return 404;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:一个靠谱的端口;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
# Show real IP in v2ray access.log
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
安装vless
- 官方一键脚本
curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
bash install-release.sh
2. 安装完毕以后,找到VPS目录文件/usr/local/etc/v2ray/config.json,复制以下代码替换。
{
"inbounds": [
{
"port": 上面靠谱的端口,
"listen":"127.0.0.1",
"protocol": "vless",
"settings": {
"decryption": "none",
"clients": [
{
"id": "1bb83c10-911e-4767-81d2-adb5177c0718",//uuid可自行生成
"level": 0
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/上面的字符串/"
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
3. 重启服务
systemctl restart v2ray
以上,完成部署。
使用方法
打开v2rayN,添加VLESS服务器,按下图设置即可。
