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
这个错误是说配置写法有错。楼主仔细检查下,是不是每句话都有分号结尾