尝试查看我的网站时出现 Nginx 错误 502 Http 错误

尝试查看我的网站时出现 Nginx 错误 502 Http 错误

当我在浏览器中查看时,website.com无法正确加载并出现 HTTP 502 错误。当我查看以下日志时:/var/log/nginx/error.log我得到:

2019/11/22 18:32:34 [error] 1761#1761: *25 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: website.com, request: "GET / HTTP/1.0", upstream: "uwsgi://127.0.0.1:8001"

我当前的 nginx 配置website如下:

# the upstream component nginx needs to connect to
upstream django {
    server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}

# configuration of the server
server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name website.com; # substitute your machine's IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 2M;   # adjust to taste

    # Django media
    #location /media  {
    #    alias ;  # your Django project's media files - amend as required
    #}

    location /static {
        alias /var/www/website/static; # your Django project's static files - amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        uwsgi_pass  django;
        include     /var/www/website/uwsgi_params; # the uwsgi_params file you installed
    }
}

这里出了什么问题?

相关内容