参考资料:
https://injoy.work/archives/ed4e432a.html
https://www.hostloc.com/thread-432082-1-1.html

安装V2Ray
SSH连接上远程VPS后,下载安装脚本:

bash <(curl -L -s https://install.direct/go.sh)

在安装完V2Ray之后,修改配置文件重启V2Ray即可,配置文件路径为/etc/v2ray/config.json

以下是V2Ray可使用的命令:

 sudo service v2ray start #启动V2Ray
 sudo service v2ray stop #停止运行V2Ray
 sudo service v2ray restart #重启V2Ray
 sudo service v2ray status #查看V2Ray状态

安装宝塔BT面板(省略)
登录BT面板后,可一键部署源码,选择安装LNMP环境;
一切都安装完后,点击「网站」——「添加站点」

成功添加完站点后,点击「设置」——SSL——Let’s Encrypt,成功申请SSL后,保存

再点击站点「设置」的「配置文件」选项,在最后一个}前添加如下代码:

    location /你的伪装路径 {

        proxy_redirect off;

        proxy_pass http://127.0.0.1:你的端口;#这个端口不能是80和443,这是本地监听端口

        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection "upgrade";

        proxy_set_header Host $http_host;

        }

回到「首页」,重启「Nignx服务」
BT面板「安全」,防火墙端口放行,新增你的V2Ray端口
修改V2Ray配置文件
打开面板「文件」,在路径中输入/etc/v2ray,编辑一下文件,并保存

{
"log" : {
  "access": "/var/log/v2ray/access.log",
  "error": "/var/log/v2ray/error.log",
  "loglevel": "warning"
},
"inbound": {
  "port": 你的端口, #自动生成的端口,须与Nignx设置的相一致,可自定义
  "protocol": "vmess",
  "settings": {
    "clients": [
      {
        "id": "b25e5370-3100-4bba-b108-0367e1239efb", #自动生成的UUID
        "level": 1,
        "alterId": 64
      }
    ]
  },
  "streamSettings": {
  "network":"ws",
  "wsSettings": {
  "path": "/你的伪装路径", #path可自定义,这里是/ws,须与Nginx和客户端的path相一致
  "headers": {
  "Host": "你的域名" #Host可自定于任意域名,此处没有添加
  }
  }
  }
},
"outbound": {
  "protocol": "freedom",
  "settings": {}
},
"outboundDetour": [
  {
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  }
],
"routing": {
  "strategy": "rules",
  "settings": {
    "rules": [
      {
        "type": "field",
        "ip": [
          "0.0.0.0/8",
          "10.0.0.0/8",
          "100.64.0.0/10",
          "127.0.0.0/8",
          "169.254.0.0/16",
          "172.16.0.0/12",
          "192.0.0.0/24",
          "192.0.2.0/24",
          "192.168.0.0/16",
          "198.18.0.0/15",
          "198.51.100.0/24",
          "203.0.113.0/24",
          "::1/128",
          "fc00::/7",
          "fe80::/10"
        ],
        "outboundTag": "blocked"
      }
    ]
  }
}
}

service v2ray restart #重启V2Ray服务
service v2ray status #查看v2ray是否运行

确保你按上述安装好,并且无错误

然后客户端大概就是

你的域名
443
uuid密码

ID:64
ws
伪装类型默认none
伪装域名就是你域名
然后底层tls
path就是上述配置文件中的伪装路径

# https://www.hostloc.com/thread-611481-1-1.html

Last modification:June 5, 2020
如果觉得我的文章对你有用,请随意赞赏