实现方法:Nginx+V2Ray(WS)+CDN(鹅厂)

需要一个备案的域名才能实现免流,因为鹅厂的 CDN 才是免流的关键
  • 示例安装环境是 CentOS7,Nginx 版本是 1.16。

搭建

安装 Nginx

因为我的初衷就是在跑网站的同时能跑免流,所以个人习惯还是 BT 面板 (呃.. 官方渠道,nginx 版本随意):
https://www.bt.cn/bbs/thread-19376-1-1.html

安装 V2Ray

一键脚本
bash <(curl -L -s https://install.direct/go.sh)
设置开机自启
systemctl enable v2ray
配置 V2Ray

清空 V2Ray 配置文件内容:

echo "" > /etc/v2ray/config.json

重新编辑配置文件:

vi /etc/v2ray/config.json

键入以下内容:

{
  "inbounds": [
    {
      "port": 10000,
      "listen":"127.0.0.1",
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "自建一个UUID",
            "alterId": 0
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
        "path": "/ray"
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

配置中的 UUID 请自行生成:https://www.uuidgenerator.net/

配置 Nginx

BT 面板直接新建一个站点,配置好 SSL,点开找到配置文件,键入:

    location /ray {
    proxy_pass       http://127.0.0.1:10000;
    proxy_redirect             off;
    proxy_http_version         1.1;
    proxy_set_header Upgrade   $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host      $http_host;
    }
}

这段是实现 Nginx 和 V2Ray 共用端口的关键,配置中的 10000 端口也要与 V2 配置中的端口对应,来源 HOSTLOC:https://www.hostloc.com/thread-432082-1-1.html

套鹅厂CDN

[免流关键]配置好 SSL,直接套鹅厂CDN:

启动 V2Ray

systemctl start v2ray

用一下命令查看 V2Ray 是否运行:

systemctl status v2ray

若成功运行会显示如下字样:

使用BT,重启 Nginx。

使用

  • 以IOS举例。

代理模式选全局,若连接后能上网而查询 IP 为小鸡 IP 则成功。

据网友测试,40G 解除封顶限制后该方法失去免流效果。

Last modification:July 17, 2019
如果觉得我的文章对你有用,欢迎打赏!