【问题标题】:502 Error Nginx and uwsgi Ubuntu Server502 错误 Nginx 和 uwsgi Ubuntu 服务器
【发布时间】:2014-08-19 11:58:43
【问题描述】:

您好,我收到以下错误,并且一直在寻找和寻找适合我情况的答案。我意识到在谷歌上搜索这个问题有很多解决方案,但我都试过了,但我无法弄清楚为什么我的下面是我的 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;
  }
}

【问题讨论】:

    标签: nginx uwsgi


    【解决方案1】:

    看来我在 uwsgi.ini 文件“socket = :”中设置的任何端口都必须与我在

    中作为服务器端口放置的端口相匹配
    upstream django {
    
        server 127.0.0.1:8001;
    }
    

    不知道这是否是一个真正的解决方案或幕后实际发生的事情,但它似乎解决了问题

    【讨论】:

      猜你喜欢
      • 2015-04-07
      • 2015-04-30
      • 1970-01-01
      • 2015-09-22
      • 2015-07-21
      • 2016-02-16
      • 2012-07-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多