2022最新在Debian系统基于nginx搭建v2ray服务端配置vmess+tls+websocket详细教程(图文)

洼地云 tuoyidashi.png

视频教程参考:Debian系统基于nginx搭建v2ray服务端配置vmess+tls+websocket详细教程

篇首语:科学上网(fanqiang)的大体原理都是通过一台在防火墙之外的VPS作为媒介,实现国内网络和防火墙之外的网络之间的互通,因此一台不受防火墙骚扰的VPS是必备的。而v2ray负责的是你的网络和VPS之间的网络通信功能。借助V2ray你可以实现透过防火墙,自由穿梭于网络。你需要做的是分别在你的设备(手机、PC等)和VPS上分别部署一下V2ray。

搭建v2ray的步骤大体如下:

  • 购买一个VPS,购买后你会获得VPS的IP、root用户及密码、SSH端口等信息;
  • 登录VPS,可以借助Xshell这个工具;
  • 安装v2ray,使用xshell成功登录VPS后,开始搭建;
  • 在你的设备上配置与VPS对应的v2ray信息,就可以成功使用了;

在开始下面的搭建工作之前,请自行购买VPS并获得VPS的相关连接信息,保证能通过Xshell等远程连接工作连接后才能进行搭建,不论使用哪家的VPS,第一步是购买完VPS之后,获取到VPS的IP、root用户及密码、SSH端口等信息,本文主要说明搭建过程,因此这里将购买VPS及使用XSHELL进行连接的过程放在:史上最详细搬瓦工VPS注册/购买图文教程(内附优惠券)

正文开始之前,先插播个广告,推荐一些性价比较高的VPS,有购买VPS打算的,可以使用我的推介链接,这样你不仅可以优惠购买,我也会得到一定的返券,感谢你对我写文创作的支持!没有购买VPS打算的,可以跳过这一部分。

一、搬瓦工VPS推荐

速度、性价比都较好: 老牌商家,一分价钱一分货,套餐选择上肯定是越好的越贵,选择适合自己的,但从速度上来说,VPS 速度:香港线路 > CN2 GIA 线路 > CN2 线路 > 普通线路。搬瓦工优惠券: BWH3HYATVBJW,此券为全网当前最高优惠力度:6.58%。

线路 CPU 内存 硬盘 带宽 流量 价格 购买链接
CN2(推荐) 1x Intel Xeon 1024 MB 20 GB SSD 1 Gbps 1 TB/月 $49.99/年 购买
CN2 GIA(特别推荐) 2x Intel Xeon 1 GB 20GB SSD 2.5 Gbps 1000GB/月 $169.99/年 购买

更多可选超高性价比套餐参见:搬瓦工VPS套餐

二、Rackerd VPS推荐

性价比较高: 提供大流量、大硬盘,支持PayPal、支付宝、微信等多种付款方式,电信走CN2 GT,联通直达机房(极佳),移动强制走联通链路,算是非CN2线路之外优化的相当不错的。

内存 CPU SSD 流量 价格 购买
768MB 1核 12GB 1T/月 $10.88/年 链接
2G 2核 35GB 4T/月 $24.98/年 链接
3GB 3核 45GB 6.5T/月 $24.28/年 链接

更多可选超高性价比套餐参见:Racknerd VPS套餐

三、Vultr主机推荐

国外VPS Vultr云主机:最低每月$2.5,免费领取$3,低价注册使用教程:国外VPS Vultr云主机注册使用教程:最低每月$2.5,免费领取$3

内存 CPU 硬盘 流量 价格 购买
0.5GB 1核 10GB 512GB/月 $2.5/月 链接
0.5GB 1核 10GB 512GB/月 $3.5/月 链接
1GB 1核 25GB 1TB/月 $5/月 链接
2GB 1核 55GB 2TB/月 $10/月 链接

更多可选超高性价比套餐参见:VPS优惠推荐

下面再来通过图文,来详细说明上面的步骤。

四、环境信息

  • 服务器系统:Debian GNU/Linux 10
  • 服务端v2ray-core版本:v4.44.0,地址:https://github.com/v2fly/v2ray-core/releases ;
  • 客户端v2rayN:5.9,地址:https://github.com/2dust/v2rayN/releases ;
  • VPS:我使用的是BandwagonHost 基本套餐 CN2 GIA,本博客也是在此VPS搭建。

五、搭建脚本说明

使用到的官网安装脚本:https://github.com/v2fly/fhs-install-v2ray,该脚本在执行时会提供info和error等信息,请仔细阅读。

六、开始搭建

6.1连接VPS

这篇文章里有使用xshell远程连接VPS的细节。

6.2更新

apt update

6.3安装curl

apt install curl

6.4安装v2ray

使用curl进行安装

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

输入vi /usr/local/etc/v2ray/config.json命令,编辑配置文件的内容为以下内容:

{
    "log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
    "inbounds": [{
            "port": 11055,
            "protocol": "vmess",
            "settings": {
                "clients": [{
                        "id": "27848739-7e62-4138-9fd3-098a63964b6b",
                        "level": 1,
                        "alterId": 0
                    }
                ]
            },
            "streamSettings": {
                "network": "ws",
                "wsSettings": {
                    "path": "/tech"
                }
            }
        }
    ],

    "outbounds": [{
            "protocol": "freedom"
        }
    ]
}

6.5 启动v2ray服务

#启动并加入开机自启
systemctl start v2ray;systemctl enable v2ray

6.6 安装nginx

执行安装

apt install -y nginx

新建网页目录

这里在假设是/root/www

mkdir -p /root/www

新建首页

/root/www目录下新建一个index.html文件,

vi /root/www/index.html

内容如下:

<html>
   <title>欢迎访问四个空格</title>
   <head><meta charset="UTF-8"></head>
   <body>
     <a href="https://www.4spaces.org/install-v2ray-v-4-44-on-debian-2022/">四个空格</a>
   </body>
</html>

新建配置文件

注: 不同版本的nginx配置文件可能有区别,我的是nginx/1.18.0,配置文件/etc/nginx/sites-enabled/default。或者你的配置文件可能在/etc/nginx/conf.d/default.conf

输入vi /etc/nginx/sites-enabled/default命令,编辑nginx配置文件为如下内容:

server{
    listen 80;
    server_name v1.xxxx.com;
    index index.html;
    root /root/www/;
}

这里你可能需要将/etc/nginx/nginx.conf中第一行user www-data改为user root,即当前用户。

启动nginx服务

#启动Nginx并设置为开机自启
systemctl start nginx;systemctl enable nginx

#查看nginx启动状态
systemctl status nginx

在浏览器里访问v1.xxxx.com,如果正常则说明nginx配置没问题,这是是没有加密的,不带HTTPS的网址:http://v1.xxxx.com

6.7 安装certbot并申请ssl证书

详细的申请证书流程参考: certbot instructions – Nginx on Debian 10 (buster)。具体如下:

安装snapd

apt install -y snapd

确保snapd为最新版本

snap install core; snap refresh core

安装certbot

snap install --classic certbot

创建软链

ln -s /snap/bin/certbot /usr/bin/certbot

申请证书

运行certbot --nginx开始申请证书,如下:

install-v2ray-on-debian-2021-1.jpg

稍等一会,会提示证书安装成功! 你会发现nginx的配置已经更改,我的/etc/nginx/sites-enabled/default文件被自动修改为以下内容:

server{
    server_name v1.xxxx.com;
    index index.html;
    root /root/www/;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/v1.xxxx.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/v1.xxxx.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server{
    if ($host = v1.xxxx.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name v1.xxxx.com;
    return 404; # managed by Certbot


}

此时,在浏览器里访问v1.xxxx.com已经是https开头的了,地址:https://v1.xxxx.com

6.8 添加v2ray转发

/etc/nginx/sites-enabled/default更改为以下内容:

server{
    server_name v1.xxxx.com;
    index index.html;
    root /root/www/;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/v1.xxxx.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/v1.xxxx.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

   ## 添加这部分内容,22055对应/usr/local/etc/v2ray/config.json 里面inbounds端口
   ## /tech客户端配置的时候需要,对应/usr/local/etc/v2ray/config.json streamSettings里的path
    location /tech {
        proxy_redirect off;
        proxy_pass http://127.0.0.1:11055;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
    }
}
server{
    if ($host = v1.xxxx.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name v1.xxxx.com;
    return 404; # managed by Certbot


}

然后运行systemctl restart nginx重启nginx。

6.9 客户端v2rayN配置

大体截图:

imagebc966e5426ace866.png

6.10 使用Google BBR开启加速

细节参考: Debian 9/10快速开启Google BBR实现v2ray高效单边加速

观看Youtube 4k高清视频,播放速度还可以:

racknerd-youtube-4k.jpg

6.11 优化网络,隐藏真实IP

细节参考: 安装warp解决Google搜索出现人机验证、解锁Netfix非自制剧最新教程

七、卸载

执行脚本的卸载命令即可:

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --remove

八、出现问题

8.1 Debian系统删除、回车不好用?

参考:解决Debian vim鼠标无法选中、复制问题

8.2 Cloudflare要不要启用CDN?

启用后比较慢,针对国内,作用可能会隐藏真实IP,除非IP被墙,大概率你是不需要启用的。

8.3 Nginx 403 forbidden错误常见情形盘点?

如果访问你的域名,nginx日志出现403错误,可以参考这篇文章:Nginx 403 forbidden错误常见情形盘点

8.4 使用v2ray访问谷歌提示异常流量?

解决办法详见: 使用v2ray访问谷歌提示异常流量

8.5 启用cloudflare cdn之后v2ray报403错误?

解决办法详见: 启用cloudflare cdn之后v2ray报403错误

8.6 防火墙端口管理

解决办法详见: CentOS开放端口的方法

8.7 Nginx日志,访问path路径,502错误?

解决办法详见: SELinux服务器Nginx反向代理返回502错误问题

8.9 CentOS无法安装snap?

解决办法详见: 如何在CentOS 8上安装Snap?

九、问题交流

  • Telegram群组

在学习的过程中遇到任何问题都可以加入Telegram群组进行交流-> 加入群组

  • 邮件:

有问题您可以可以通过邮件进行沟通:欢迎联系

赞(9)
未经允许禁止转载:优米格 » 2022最新在Debian系统基于nginx搭建v2ray服务端配置vmess+tls+websocket详细教程(图文)

评论 68

  1. #1

    感谢楼主,可用!

    013年前 (2021-06-08)回复
    • 很高兴对你有帮助!

      michael3年前 (2021-06-08)回复
  2. #2

    请问有ios小火箭的配置教程吗?

    013年前 (2021-06-10)回复
  3. #3

    可以通过二维码的方式来配置,不用了。~

    013年前 (2021-06-10)回复
  4. #4

    请问这样设置完会自动更新证书吗?

    乔治3年前 (2021-06-11)回复
    • 可以通过定时任务的方式实现更新,参考:https://www.4spaces.org/nginx-lets-encrypt-ssl/

      michael3年前 (2021-06-12)回复
      • 很高兴收到你的回复,感谢!

        乔治3年前 (2021-06-13)回复
  5. #5

    会不会被GOV 监控异常流量?

    Moopa3年前 (2021-06-18)回复
    • 现在显示的是ssl流量,跟正常上网没两样。

      michael3年前 (2021-06-19)回复
  6. #6

    #查看nginx启动状态 Active: active (running)
    但是上不了网页,后续申请证书也失败了,是namesilo里需要设置什么吗?

    ghsxyz3年前 (2021-06-23)回复
    • 估计是域名解析的不对,没申请证书之前能访问吗

      michael3年前 (2021-06-24)回复
      • 也不行,后来看了下似乎是端口没开放,输入下面两个指令就好了,但总感觉哪里不对劲。
        sudo iptables -A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
        sudo iptables -A INPUT -p tcp -m tcp –dport 443 -j ACCEPT

        ghsxyz3年前 (2021-06-25)回复
        • 是不是你的VPS供应商对端口有限制,需要自行开放端口?

          michael3年前 (2021-06-29)回复
  7. #7

    运行 certbot –nginx 提示
    Error while running nginx -c /etc/nginx/nginx.conf -t.

    nginx: [emerg] unexpeted end of file, expecting “}” in /etc/nginx/conf.d/v2ray.conf:6
    nginx: configuration file /etc/nginx/nginx.conf test failed
    不会解决

    kexibushini3年前 (2021-06-28)回复
    • nginx配置文件有错误,仔细核对下,或者发我截图我帮你看下。

      michael3年前 (2021-06-28)回复
  8. #8

    楼楼,有trojan 的搭建脚本吗

    alu3年前 (2021-06-28)回复
  9. #9

    您好,大神,我在设置nginx仓库地址那一步卡住了,显示:
    -bash: lsb_release: command not found
    deb http://nginx.org/packages/debian nginx

    请问怎么处理啊,大神。我系统是Debian 10 x86_64

    wintell3年前 (2021-07-01)回复
    • sudo apt install lsb-core

      michael3年前 (2021-07-01)回复
      • 大神,还是报错了,麻烦您看看哈
        【第一次安装,显示错误】——
        Reading package lists… Done
        Building dependency tree
        Reading state information… Done
        Package lsb-core is not available, but is referred to by another package.
        This may mean that the package is missing, has been obsoleted, or
        is only available from another source

        E: Package ‘lsb-core’ has no installation candidate

        【再次安装,显示错误】——
        E: Malformed entry 1 in list file /etc/apt/sources.list.d/nginx.list (Component)
        E: The list of sources could not be read.

        wintell3年前 (2021-07-01)回复
      • 谢谢大神,这个问题搞定了

        wintell3年前 (2021-07-01)回复
  10. #10

    您好,大佬,我启动nginx后,xshell就断开了,ssh端口连不上,tcp不可用。请问该如何解决呢?我系统是Debian 10 x86_64

    wintell3年前 (2021-07-01)回复
    • IP能ping通吗,可以在电报群里发下情况,回复的及时点,或者发邮件。

      michael3年前 (2021-07-01)回复
      • 谢谢大神,这问题搞定了,原来是我之前upgrade ca-certificates 的时候
        A new version (/tmp/filecih8Cn) of configuration file /etc/ssh/sshd_config is available, but the version installed currently has been locally modified. │
        把这个文件也升级了

        wintell3年前 (2021-07-02)回复
  11. #11

    启动nginx服务后浏览器上不去vi网址,是哪里出了问题呢,是不能用除了com以外的域名吗

    w3年前 (2021-07-01)回复
  12. #12

    大神,我完全按照教程来做,也自己弄了个图文网页,但是把整个教程全做一遍后,网页能打开,但是没有内容,是空白的,请问是哪里出问题了呢

    wintell3年前 (2021-07-02)回复
    • 网页就是空白的,我只写了个标题

      michael3年前 (2021-07-07)回复
  13. #13

    大神,我Debian 10 x86_64,v2ray启动不了,报错
    v2ray.service – V2Ray Service
    Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/v2ray.service.d
    └─10-donot_touch_single_conf.conf
    Active: failed (Result: exit-code) since Thu 2021-07-01 21:51:42 EDT; 1h 41min ago
    Docs: https://www.v2fly.org/
    Process: 20229 ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json (code=exited, status=23)
    Main PID: 20229 (code=exited, status=23)

    Jul 01 21:51:42 clean-echo-1.localdomain systemd[1]: Started V2Ray Service.
    Jul 01 21:51:42 clean-echo-1.localdomain v2ray[20229]: V2Ray 4.40.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.16.5 linux/amd64)
    Jul 01 21:51:42 clean-echo-1.localdomain v2ray[20229]: A unified platform for anti-censorship.
    Jul 01 21:51:42 clean-echo-1.localdomain v2ray[20229]: 2021/07/01 21:51:42 [Info] main/jsonem: Reading config: /usr/local/etc/v2ray/config.json
    Jul 01 21:51:42 clean-echo-1.localdomain v2ray[20229]: main: failed to create server > proxy/vmess/inbound: failed to get VMess user > proxy/vmess: failed to parse ID > encoding/hex: invalid byte: U+0073 ‘s’
    Jul 01 21:51:42 clean-echo-1.localdomain systemd[1]: v2ray.service: Main process exited, code=exited, status=23/n/a
    Jul 01 21:51:42 clean-echo-1.localdomain systemd[1]: v2ray.service: Failed with result ‘exit-code’.
    ~

    wintell3年前 (2021-07-02)回复
    • 可以在Telegram上发下你的配置信息,我帮你看看。

      michael3年前 (2021-07-07)回复
  14. #14

    [Warning] failed to handler mux client connection > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://我设置的路径): 301 Moved Permanently > websocket: bad handshake] > v2ray.com/core/common/retry: all retry attempts failed
    请问:这个如何解决?另教程上的路径 location /v2ray { <====这个是要在哪里建立文件?还是随便自己写个路径,只要两个配置文件的路径一致就可以?在服务器中不需要建立实际路径与文件

    愚者3年前 (2021-07-09)回复
    • 路径是 /etc/nginx/conf.d/ 下面,文件名随便取,不会可以邮件或telgram联系,我帮你看看

      michael3年前 (2021-07-12)回复
  15. #15

    网站可以打开,当时链接报错这个错v2ray.com/core/proxy/http: failed to read response from speedtest-sgp1.digitalocean.com > unexpected EOF

    cheng3年前 (2021-08-11)回复
  16. #16

    装了一个screen,从debian9升级到了Debian10,重启了一下就这样了:
    root@racknerd-3b863f:~# systemctl start nginx
    Job for nginx.service failed because the control process exited with error code.
    See “systemctl status nginx.service” and “journalctl -xe” for details.

    郑苗3年前 (2021-08-30)回复
    • 应该是你nginx配置有误,检查下配置文件。 根据提示查看下 `systemctl status nginx.service`。

      michael3年前 (2021-08-30)回复
  17. #17

    Aug 30 09:52:19 racknerd-3b863f systemd[1]: Starting A high performance web server and a reverse proxy server…
    Aug 30 09:52:19 racknerd-3b863f nginx[3354]: nginx: [emerg] cannot load certificate “/etc/letsencrypt/live/v1.xxxx.com/fullchain.pem”: BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(‘/etc/letsenc>
    Aug 30 09:52:19 racknerd-3b863f nginx[3354]: nginx: configuration file /etc/nginx/nginx.conf test failed
    Aug 30 09:52:19 racknerd-3b863f systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
    Aug 30 09:52:19 racknerd-3b863f systemd[1]: nginx.service: Failed with result ‘exit-code’.
    Aug 30 09:52:19 racknerd-3b863f systemd[1]: Failed to start A high performance web server and a reverse proxy server.

    郑苗3年前 (2021-08-30)回复
  18. #18

    好了,我是傻子,忘改网址了,我以为就第一排的一个

    郑苗3年前 (2021-08-30)回复
  19. #19

    Downloading verification file for V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v4.41.1/v2ray-linux-64.zip.dgst
    /dev/fd/63: line 308: /usr/bin/unzip: No such file or directory
    error: V2Ray decompression failed.
    按照楼主的教程,安装v2ray的时候无法解压,是需要单独安装解压软件吗?

    hippo3年前 (2021-09-07)回复
    • 嗯,可能你的VPS没有预装zip unzip。安装以下就行了

      michael3年前 (2021-09-12)回复
  20. #20

    3.8添加转发那里不会了,里面没有用到21602啊

    cicik2年前 (2021-10-19)回复
  21. #21

    我用了17.88刀的那个服务器,前几天网速突然掉到0.3M/S是怎么回事

    郑苗2年前 (2021-10-28)回复
  22. #22

    楼主你好, 我在3.6 哪里复制粘贴到Xshell 但是就没有成功command not found
    。 黄色和蓝色 以及斜杠全部都要复制进去吗 ?

    不懂却很猛2年前 (2021-11-08)回复
    • command not found 是指什么命令没找到?

      巴巴主机2年前 (2021-11-09)回复
    • 对的,都复制进去

      巴巴主机2年前 (2021-11-09)回复
  23. #23

    大神 您好 安照教程都配置完了 网站正常打开 v2ray 客户端连接还是有问题 麻烦能帮忙看下吗
    2021/11/24 13:04:42 [Warning] failed to handler mux client connection > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://*.*.*.*/v2ray): > x509: cannot validate certificate for *.*.*.* because it doesn't contain any IP SANs] > v2ray.com/core/common/retry: all retry attempts failed
    网上搜索下说是生成证书时,没有包含此ip。 能教下怎么解决吗 RN的vps 谢谢!

    ahbbws2年前 (2021-11-24)回复
    • 证书申请成功了吗

      巴巴主机2年前 (2021-11-24)回复
    • 给您发邮件回复了

      巴巴主机2年前 (2021-11-24)回复
      • 您好 感谢回复, 证书申请成功 ,HTTPS访问正常 邮件没有收到 这是是 v2ray.conf 配置
        server{
        server_name http://www.xxxx.xxx;
        index index.html;
        root /root/www/;

        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/www.xxxx.xxx/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/www.xxxx.xxx/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

        ## 添加这部分内容,21602对应/usr/local/etc/v2ray/config.json 里面inbounds端口
        ## /v2ray客户端配置的时候需要,对应/usr/local/etc/v2ray/config.json streamSettings里的path
        location /v2ray {
        proxy_redirect off;
        proxy_pass http://127.0.0.1:21618;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        }
        }
        server{
        if ($host = http://www.xxxx.xxx) {
        return 301 https://$host$request_uri;
        } # managed by Certbot

        listen 80;
        server_name http://www.xxxx.xxx;
        return 404; # managed by Certbot

        ahbbws2年前 (2021-11-25)回复
        • 能再贴下v2ray的配置文件吗

          巴巴主机2年前 (2021-11-26)回复
          • 大神v2ray启动失败,
            v2ray.service – V2Ray Service
            Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: enabled)
            Drop-In: /etc/systemd/system/v2ray.service.d
            └─10-donot_touch_single_conf.conf
            Active: failed (Result: exit-code) since Tue 2021-11-30 01:56:34 UTC; 3s ago
            Docs: https://www.v2fly.org/
            Process: 2368 ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json (code=exited, status=2)
            Main PID: 2368 (code=exited, status=2)
            CPU: 5ms

            Nov 30 01:56:33 vultr systemd[1]: v2ray.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
            Nov 30 01:56:33 vultr systemd[1]: v2ray.service: Failed with result 'exit-code'.
            Nov 30 01:56:34 vultr systemd[1]: v2ray.service: Scheduled restart job, restart counter is at 5.
            Nov 30 01:56:34 vultr systemd[1]: Stopped V2Ray Service.
            Nov 30 01:56:34 vultr systemd[1]: v2ray.service: Start request repeated too quickly.
            Nov 30 01:56:34 vultr systemd[1]: v2ray.service: Failed with result 'exit-code'.
            Nov 30 01:56:34 vultr systemd[1]: Failed to start V2Ray Service.

            newvp2年前 (2021-11-30)
          • Nov 30 01:56:33 vultr systemd[1]: v2ray.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
            Nov 30 01:56:33 vultr systemd[1]: v2ray.service: Failed with result 'exit-code'.
            Nov 30 01:56:34 vultr systemd[1]: v2ray.service: Scheduled restart job, restart counter is at 5.
            Nov 30 01:56:34 vultr systemd[1]: Stopped V2Ray Service.
            Nov 30 01:56:34 vultr systemd[1]: v2ray.service: Start request repeated too quickly.
            Nov 30 01:56:34 vultr systemd[1]: v2ray.service: Failed with result 'exit-code'.
            Nov 30 01:56:34 vultr systemd[1]: Failed to start V2Ray Service.
            root@vultr:~# ps -ef|grep v2ray
            root 2377 1646 0 01:56 pts/0 00:00:00 grep v2ray

            newvp2年前 (2021-11-30)
          • 配置问题?

            巴巴主机2年前 (2021-11-30)
  24. #24

    申请证书前网页能正常打开,证书申请成功后,网页无法正常运作,重新定向次数过多??

    100012年前 (2021-11-29)回复
    • 你是用的cloudflare解析的吗,如果是在cloudflare 导航栏SSL里改为full。

      巴巴主机2年前 (2021-11-30)回复
  25. #25

    还有/usr/local/etc/v2ray/config.json文件下的端口以及id从哪里看?

    100012年前 (2021-11-29)回复
  26. #26

    网页无法访问和ip的问题,我解决了,但是这个21602的端口是怎么来的,还是没搞明白

    100012年前 (2021-11-30)回复
    • 我自己随便指定的,你也可以指定其他的端口。

      巴巴主机2年前 (2021-11-30)回复
  27. #27

    哪位网友,把教程制作成一键脚本呀?

    Dfghjnbb2年前 (2021-12-06)回复
  28. #28

    你好,请问网址无法访问是什么情况?

    mage93082年前 (2021-12-06)回复
    • 什么网址?

      巴巴主机2年前 (2021-12-06)回复
  29. #29

    还是感觉很复杂

    胆小爱吃鸡2年前 (2022-01-20)回复
  30. #30

    请问按照流程一切配置好了,网页也能打开。但是客户端v2rayN配置后连接显示
    failed to handler mux client connection > v2ray.com/core/proxy/vmess/outbound: connection ends > v2ray.com/core/proxy/vmess/outbound: failed to read header > v2ray.com/core/proxy/vmess/encoding: failed to read response header > websocket: close 1000 (normal)
    这是什么原因呢?

    danieljyj2年前 (2022-05-09)回复
    • 我也这样 有谁知道原因吗

      小玲子2年前 (2022-05-28)回复
      • 这样描述有点模糊,v2rayN能正常访问Google之类的吗

        巴巴主机2年前 (2022-05-30)回复
    • 一般来讲是主机的时区和时间和本地时间不一致,我弄了一下午没成功,用ntp同步时间也没用,貌似debian的hwclock计算方式和centos不一样,换centos就没这个问题了。

      Terry1年前 (2022-10-29)回复
  31. #31

    能够连上v2ray,https也能打开,但是打开v2ray以后就上不了网,没有报错,是怎么回事呢?

    122年前 (2022-07-10)回复
    • 方便贴下nginx和v2ray的配置吗,个人信息打码

      巴巴主机2年前 (2022-07-10)回复
  32. #32

    我按文档配置以后,可以连接,但是网络不通,nginx报错如下:
    [16/May/2023:23:29:49 -0400] "GET /tech HTTP/1.1" 301 185 "-" "Go-http-client/1.1"
    请问这可能是哪里的问题?

    keone11个月前 (05-17)回复
    • 这不是错误吧,可以连接是指什么可以连接?网络不通是指怎么不通?

      优米格11个月前 (05-18)回复

合作&反馈&投稿

商务合作、问题反馈、投稿,欢迎联系

广告合作侵权联系

登录

找回密码

注册