思绪的空中生活

宝塔面板 V2ray Websocket Nginx Cloudflare
前言:v2ray通过cloudflare拯救被封的IP,之前一直用的233blog的一键脚本,奈何nfp的ovz换...
扫描右侧二维码阅读全文
25
2019/01

宝塔面板 V2ray Websocket Nginx Cloudflare

前言:
v2ray通过cloudflare拯救被封的IP,之前一直用的233blog的一键脚本,奈何nfp的ovz换了4次系统都没能成功实现,所以手动搭建了,顺便开个记录贴

域名解析

1.使用cloudflare解析域名,为了方便测试,可以先把云朵点灰、关闭cdn(非必要,如果点灰了最后记得再次点亮云朵图标开启cdn)

安装宝塔面板

1.根据自己的系统使用正确的命令安装:

Centos安装命令
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh

Debian安装命令
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && bash install.sh

2.安装完成后,登录BT面板,安装nginx
3.添加站点
输入自己的网址,ftp、数据库、php都不用
4.申请ssl
点击「设置」——SSL——Let’s Encrypt,成功申请SSL后,保存
5.更改 配置文件
再次点击站点「设置」的「配置文件」选项,在最后一个}前添加如下代码:

    location / {
    proxy_redirect off;
    proxy_pass http://127.0.0.1:25534;#25534是v2ray的端口号,注意和之后安装的一致
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    }

6.重启Nignx

安装v2ray

1.安装命令
bash <(curl -L -s https://install.direct/go.sh)
2.修改v2ray配置文件,路径/etc/v2ray/config.json,修改后记得重启v2ray
参考配置:

{
    "log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
    "inbound": {
        "port": 25534,#自己的端口号需要对应
        "protocol": "vmess",
        "settings": {
            "udp": true,
            "clients": [
                {
                    "id": "e5cee2d4-d28b-4b8a-83ef-cf788bf1****",#自己的id
                    "level": 1,
                    "alterId": 233
                }
            ]
        },
        "streamSettings": {
            "network": "ws"
        }
    },
    "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"
                }
            ]
        }
    }
}

3.V2Ray可使用的命令:

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

相关文章:

  • 小米路由器r3g刷老毛子Padavan
  • 解决v2ray 500错误
  • .tk/.ml/.cf/.gq/.ga域名续约
  • Padavan开启frp
  • debian 9 /etc/rc.local开机启动
  • Last modification:January 25th, 2019 at 11:47 pm
    If you think my article is useful to you, please feel free to appreciate

    Leave a Comment