502错误Nginx和uwsgi Ubuntu服务器

时间:2014-08-19 03:23:32

标签: nginx uwsgi

您好我收到以下错误并一直在搜索并寻找我的情况的答案。我知道谷歌搜索这个问题有很多解决方案,但我已经尝试了所有,无法弄清楚为什么我的不工作下面是我的nginx.conf和错误的日志请让我知道如果需要更多的信息

日志

2014/08/18 20:03:36 [error] 27960#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: , request: "GET / HTTP/1.1", upstream: "uwsgi://192.168.0.13:8081", host: "mysite.com"
2014/08/18 20:05:01 [error] 27960#0: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "uwsgi://192.168.0.13:8081", host: "mysite.com"
2014/08/18 20:08:19 [error] 28371#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: , request: "GET / HTTP/1.1", upstream: "uwsgi://127.0.0.1:8001", host: "mysite.com"
2014/08/18 20:08:21 [error] 28371#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: , request: "GET / HTTP/1.1", upstream: "uwsgi://127.0.0.1:8001", host: "mysite.com"

.conf文件

upstream django {

server 127.0.0.1:8001;
}



server {
  location / {
    include /etc/nginx/uwsgi_params;
    uwsgi_pass django;
  }
}

1 个答案:

答案 0 :(得分:0)

所以我在uwsgi.ini文件中设置的任何端口“socket =:”必须匹配我作为服务器端口的端口

upstream django {

    server 127.0.0.1:8001;
}

不知道这是否是一个真正的解决方案或者是什么事情真的发生在场景中但它似乎解决了这个问题