Nginx, Gunicorn, Django Сервер Ubuntu 502 Плохой шлюз - PullRequest
0 голосов
/ 06 мая 2020

Я получаю сообщение об ошибке неверного запроса 502, когда пытаюсь загрузить страницу. Я установил приложение django на Gunicorn, nginx и супервизоре. Я просмотрел другие сообщения здесь, и они не устранили проблему.

журналы ошибок nginx включают такие сообщения

2020/05/06 15:09:00 [crit] 7361#7361: *4 connect() to unix:/home/USER/APP/APP.sock failed (2: No such file or directory) while connecting to upstream, client: IP, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/home/USER/APP/APP.sock:/", host: "HOST"

файл конфигурации супервизора

[program:APP]
command=/home/USER/APP/site/bin/python3.7 /home/USER/APP/site/bin/gunicorn --workers 3 --preload --timeout 120 --bind unix:/home/USER/APP/APP.sock APP.wsgi:application
directory=/home/USER/APP
autostart=true
autorestart=true
stderr_logfile=/var/log/APP.err.log
stdout_logfile=/var/log/APP.out.log

nginx файл конфигурации

server {
    listen 80;
    server_name _;

    location = /favicon.ico { access_log off; log_not_found off; }

    location /static/ {
            root /home/USER/APP;
    }

    location / {
            include proxy_params;
            proxy_pass http://unix:/home/USER/APP/APP.sock;
    }
}
...