0

When I go to view my website.com in the browser it fails to properly load with a HTTP 502 error. When I view the logs at: /var/log/nginx/error.log I get:

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"

My current nginx config called website looks like:

# 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
    }
}

What is going wrong here?

0 Answers0