1.首先你的准备如下东西

① vps

② 域名解析好

③ 用cf家的cdn

④ 域名解析到IP

2.安装宝塔并安装nginx

这一步没教程,自己去百度。

3.宝塔安装好后创建个网站

这一步也没教程,傻瓜化的谁都会

4.配置一下创建好的nginx文件,添加如下东西

location /ray{                            #这个路径随便怎么设置
   proxy_redirect off;
   proxy_pass http://127.0.0.1:419;       #这个端口随便怎么设置,但是要在防火墙中放行
   proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "upgrade";
   proxy_set_header Host $http_host;
}

5.配置网站ssl。

这一步也没教程,cf后台自己去配置

6. 安装v2roy

wget https://install.direct/go.sh
bash go.sh

7.改配置文件

cd /etc/v2ray
vi config.json
{
  "inbounds": [
    {
      "port": 419,			    #之前在Nginx中设置的端口
      "listen":"127.0.0.1",
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "******************",     #刚刚得到的uuid,也可以自行生成一个uuid(可用PC版v2ray生成)
            "alterId": 64
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
        "path": "/ray"		            #刚刚设置的路径
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

8.启动一下

systemctl start v2ray

9.客户端配置

https://github.com/v2ray/v2ray-core/releases

下载好后解压出来修改config.json

{
    "inbounds": [
        {
            "port": 1087,
            "listen": "127.0.0.1",
            "protocol": "http",
            "settings": {
                "allowTransparent": true
            }
        },
        {
            "port": 1086,
            "listen": "127.0.0.1",
            "protocol": "socks",
            "domainOverride": [
                "tls",
                "http"
            ],
            "settings": {
                "auth": "noauth",
                "udp": true
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "vmess",
            "settings": {
                "vnext": [
                    {
                        "address": "你的域名",
                        "port": 443,
                        "users": [
                            {
                                "id": "你的uuid",
                                "alterId": 64,
                                "security": "auto"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "ws",
                "wsSettings": {
                    "path": "/ray"
                },
                "security": "tls"
            },
            "mux": {
                "enabled": false,
                "concurrency": 8
            },
            "tag": "proxy"
        },
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        },
        {
            "protocol": "blackhole",
            "settings": {},
            "tag": "block"
        }
    ],
    "log": {
        "loglevel": "none",
        "access": "D:/v2ray_access.log",
        "error": "D:/v2ray_error.log"
    },
    "dns": {
        "hosts": {
            "example.com": "127.0.0.1"
        },
        "servers": [
            "223.5.5.5",
            "8.8.8.8",
            "localhost"
        ]
    },
    "routing": {
        "strategy": "rules",
        "settings": {
            "domainStrategy": "IPIfNonMatch",
            "rules": [
                {
                    "type": "field",
                    "domain": [
                        "dropbox",
                        "github",
                        "google",
                        "instagram",
                        "netflix",
                        "pinterest",
                        "pixiv",
                        "tumblr",
                        "twitter",
                        "domain:facebook.com",
                        "domain:fbcdn.net",
                        "domain:fivecdm.com",
                        "domain:ggpht.com",
                        "domain:gstatic.com",
                        "domain:line-scdn.net",
                        "domain:line.me",
                        "domain:medium.com",
                        "domain:naver.jp",
                        "domain:pximg.net",
                        "domain:t.co",
                        "domain:twimg.com",
                        "domain:youtube.com",
                        "domain:ytimg.com"
                    ],
                    "outboundTag": "proxy"
                },
                {
                    "type": "field",
                    "ip": [
                        "125.209.222.0/24",
                        "149.154.167.0/24",
                        "149.154.175.0/24",
                        "91.108.56.0/24"
                    ],
                    "outboundTag": "proxy"
                },
                {
                    "type": "field",
                    "domain": [
                        "cctv",
                        "geosite:cn",
                        "umeng",
                        "domain:apple.com",
                        "domain:crashlytics.com",
                        "domain:icloud.com",
                        "domain:ixigua.com",
                        "domain:pstatp.com",
                        "domain:snssdk.com",
                        "domain:toutiao.com"
                    ],
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "ip": [
                        "geoip:cn",
                        "geoip:private"
                    ],
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "domain": [
                        "domain:doubleclick.net"
                    ],
                    "outboundTag": "block"
                }
            ]
        }
    }
}

大概就这些了,能学学,不能学别学。

说点什么
支持Markdown语法
在"宝塔环境下V2Ray的Websocket+TLS+Nginx+CDN模式的部署"已有1条评论
Loading...