最近SSR封的太厉害,估计我GFW已经掌握了SSR流量嗅探技术。通过一番google学习,决定改用v2ray。
因为服务器上安装了宝塔面板,挂了网站,所以采用Websocket+TLS+Nginx模式部署v2ray服务。

记录流程如下,希望能帮到刚入门的同学

1、前期准备(针对新服务器)

2、新建网站部署SSL(TLS)

在宝塔面板新建一个网站,开启SSL。在配置文件最后一个“}”前,插入如下代码:

location /v2ray{                      #路径可随便指定,但不建议用 “/” 根目录
   proxy_redirect off;
   proxy_pass http://127.0.0.1:888;   #端口可随便设置,和v2ray配置文件一致
   proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "upgrade";
   proxy_set_header Host $http_host;
}

3、安装和更新 V2Ray

3.1安装和更新 V2Ray(安装可执行文件和 .dat 数据文件)

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

3.2安装最新发行的 geoip.dat 和 geosite.dat(只更新 .dat 数据文件)

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

3.3移除 V2Ray

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

3.4安装完后的文件目录

installed: /usr/local/bin/v2ray
installed: /usr/local/bin/v2ctl
installed: /usr/local/share/v2ray/geoip.dat
installed: /usr/local/share/v2ray/geosite.dat
installed: /usr/local/etc/v2ray/config.json
installed: /var/log/v2ray/
installed: /var/log/v2ray/access.log
installed: /var/log/v2ray/error.log
installed: /etc/systemd/system/v2ray.service
installed: /etc/systemd/system/v2ray@.service

4、配置v2ray

打开/usr/local/etc/v2ray/config.json,修改配置文件内容如下:

{
  "inbounds": [
    {
      "port": 888,                #之前在Nginx配置文件中设置的端口
      "listen":"127.0.0.1",
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "******************",   #安装时自动生成
            "alterId": 64
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
        "path": "/ray"              #之前在Nginx配置文件中设置的路径
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

5、重启v2ray

重启v2ray
service v2ray restart

确认启动状态
service v2ray status

6、客户端配置

windows客户端下载:https://github.com/2dust/v2rayN/releases
Android客户端下载:https://github.com/2dust/v2rayNG/releases

  • 地址为你的域名;
  • 端口为443; #这里必须是443端口
  • Uuid为刚刚设置的uuid;
  • 协议为Websocket(ws);
  • 路径为 /v2ray(或者你设置的路径);
  • 开启tls。