介于国内的形势以及 SSR 作者破娃不再更新,一个更加安全以及更加快捷的翻墙需要快速的更新换代,所以 v2ray 使用 vmess 作为一种平台的方式出现在人们面前,但是由于折腾需要一点基本常识,所以 v2ray 的发展并不算太过普及,直到一键脚本的诞生才大量推广了 v2ray。但是更加安全的方式还是需要手动来安装。所以才有了本次教程的诞生。

环境
本次教程中使用的是 Debian8 × 64 mini
SSH 连接工具
一台 VPS 点击购买
域名
更新

apt-get update

安装 V2ray
因为本次的教程是 mini 系统,所以一些常规包并不具备,这里还需要安装 unzip 之类

apt install unzip daemon curl

之后再执行

bash <(curl -L -s https://install.direct/go.sh)

安裝 EasyEngine
要想使用上述 TLS 以及 nginx,只需要 EasyEngine 便能解决,它更加方便

wget -qO ee rt.cx/ee && sudo bash ee

中间需要输入 NAME 以及你的邮箱 完成 setup 以后输入

source /etc/bash_completion.d/ee_auto.rc

安装 Nginx

ee site create example.com --html --letsencrypt

其中 example.com 是你的域名

cd /var/www/example.com/conf/nginx

进入 nginx 的 conf

vi v2ray.conf

编辑配置文件如下

  location /enterv2ray/ {
    proxy_redirect off;
    proxy_pass http://127.0.0.1:10252; #此处的11054为你的v2ray端口。请自己修改
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
  }
cp /var/www/html/index.nginx-debian.html /var/www/example.com/htdocs/index.html && chown www-data: /var/www/example.com/htdocs/index.html

重启 nginx

service nginx restart
设置 v2ray
备份之前数据 cp /etc/v2ray/config.json /etc/v2ray/config.json.bak

修改 config 服务端

rm /etc/v2ray/config.json && vi /etc/v2ray/config.json

将其中的端口 port 以及 UUID 修改成你自己的

{
    "log": {
            "access": "/var/log/v2ray/access.log",
            "error": "/var/log/v2ray/error.log",
            "loglevel": "warning"
    },
    "inbound": {
            "port": 1025,
            "protocol": "vmess",
            "settings": {
                    "clients": [{
                            "id": "061dc924-dbe0-4175-953e-2b7e6255c86c",
                            "level": 1,
                            "alterId": 64,
                            "security": "auto"
                    }]
            },
            "streamSettings":{
                    "network":"ws",
                    "security": "auto",
                    "wsSettings":{
                            "connectionReuse": true,
                            "path": "/enterv2ray/"
                            }
                    }
    },
    "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"
                }
            ]
        }
    }
}

如果你想获取一个全新的 UUID 请访问 https://www.uuidgenerator.net/
或者使用 https://htfy96.github.io/v2ray-config-gen/ 配置全新的 v2ray 服务端以及客户端

使用 CDN 隐藏真实 IP

  1. 修改 nginx.conf
    文件位于 /usr/local/nginx/conf/

打开该文件

vi /usr/local/nginx/conf/nginx.conf

在代码 http {} 段里添加一句

proxy_intercept_errors on;

保存退出即可

  1. 修改 vhost 文件
    文件位于 /usr/local/nginx/conf/vhost/

打开该文件

vi /usr/local/nginx/conf/vhost/www.yourdomain.com.conf

在 443 端口的配置里加一句

error_page 400 = https://www.yourdomain.com/xxxx;

保存退出重启 nginx

service nginx restart
文章作者: 辣比丶小新
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Y丶Zon
资源 ss v2ray linux
喜欢就支持一下吧