【发布时间】:2015-07-13 11:54:00
【问题描述】:
我正在使用 nginx 来上游服务器 nodeJs APP。
我有这个错误:
2015/05/04 08:41:46 [crit] 5355#0: *7 connect() to 127.0.0.1:2000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: ws-test.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:2000/", host: "ws-test.com"
是的,我们有很多例子要纠正,但没有任何效果......
我已将 nginx.conf 中的用户更改为正在连接的用户:like here
user adminmf
我为我的项目更改了 chmod:775
这是我的会议:
upstream proxy {
# Correspond au serveur proxy que vous avez lancé avec npm run startProxy
server localhost:2000;
}
server {
listen 80;
server_name ws-test.com;
location / {
proxy_pass http://proxy;
}
error_log /var/log/nginx/proxyWS.error.log;
access_log /var/log/nginx/proxyWS.access.log;
}
如果我使用命令
curl http://localhost:2000/
curl http://127.0.0.1:2000/
我的服务器正在运行....
但不是:
curl http://ws-test.com
是的,我的 /etc/hosts 中有这一行
127.0.0.1 ws-test.com
我需要帮助!
【问题讨论】:
-
因为 ws-test.com 表示 ws-test.com:80 ,您的服务器没有在监听。
-
我的服务器正在监听 80 端口:监听 80;如果我使用 curl ws-test.com:80 问题是一样的
-
没有别的了?没人更正吗?它已经不工作了....
-
我在这里解决了我的问题:stackoverflow.com/questions/23948527/…第二个答案