2020年4月16日星期四

宝塔 网页和V2Ray共存

转自
https://www.v2rayssr.com/v2raybaota.html

假设宝塔用nginx搭建好网页;
站点修改-配置文件-在#SSL-END 之前加一段

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



用233boy一键脚本或官方V2Ray脚本

bash <(curl -s -L https://git.io/v2ray.sh)

1-TCP装好后,
编辑 /etc/v2ray/config.json

下面整段覆盖进去

{
  "inbounds": [{
    "port": 65432,           //此处为安装时生成的端口,可修改随意,但是保证和下面提到的端口号相同
    "listen":"127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "fc43ab1a-1e9e-4fb0-a905-69e9505bcbb6",
          "level": 1,
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path": "/nginx"   //此处为路径,需要和下面 NGINX 上面的路径配置一样
      }
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  },{
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  }],
  "routing": {
    "rules": [
      {
        "type": "field",
        "ip": ["geoip:private"],
        "outboundTag": "blocked"
      }
    ]
  }
}

#重启v2
service v2ray restart

即可通过网站域名 v2 ws tls 连接。path填红字nginx 。

没有评论:

发表评论

openwrt在线编译 插件名字查找

openwrt在线编译 https://firmware-selector.staging.immortalwrt.org/ 插件名字查找 https://downloads.staging.immortalwrt.org/releases/23.05.1/packages/x8...