跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 请问下v2ray里面nginx的配置怎么写
未分類
9 4 月 2020

请问下v2ray里面nginx的配置怎么写

xiaozhenghi 大佬有话说 : 2020-3-18 14:26:59

请问下v2ray里面nginx的配置怎么写

用的宝塔,然后咋写都是提示错误。。。无奈了。

location / {
      proxy_redirect off;
      proxy_pass http://127.0.0.1:与安装v2ray设置的端口一致;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header Host $http_host;
      }

然后报这个错误
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed

英梨梨 大佬有话说 : 2020-3-18 14:28:41

写在root /www/wwwroot/xxxxx下边

luceos 大佬有话说 : 2020-3-18 14:29:01

看着没问题啊,你不会与安装v2ray设置的端口一致; 这句话也没改吧,nginx -t 看看哪一行有错误

clcavril 大佬有话说 : 2020-3-18 14:31:39

location / {这里要指定路径吧?????????

whiledone 大佬有话说 : 2020-3-18 14:33:26

本帖最后由 whiledone 于 2020-3-18 14:35 编辑

端口号哪去了?

location /f2ng { # 与 V2Ray 配置中的 path 保持一致
      proxy_redirect off;
      proxy_pass http://127.0.0.1:50000; # 假设v2ray的监听地址是50000
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header Host $host;
      # Show real IP in v2ray access.log
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

xiaozhenghi 大佬有话说 : 2020-3-18 15:01:16

搞好了,写到括号里

zhbone 大佬有话说 : 2020-3-18 15:07:07

这个错误是说配置写法有错。楼主仔细检查下,是不是每句话都有分号结尾

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具