V
V
Vadim kyklaed2017-09-15 16:51:12
Django
Vadim kyklaed, 2017-09-15 16:51:12

What is the error nginx+gunicorn+django = 502 bad gateway?

Hello, the problem is that I'm trying to set up a web server on a vps. configured according to this manual https://www.digitalocean.com/community/tutorials/h... I
encountered the fact that nginx does not communicate with gunicorn
if you just run gunicorn --bind pystart.ru:8000 firstapp.wsgi
then everything works.
(13: Permission denied) while connecting to upstream, client:
drwxr-xr-x root root /
drwx------ root root root
drwxr-xr-x root root firstapp
srwxrwxrwx root www-data firstapp.sock
running service report
Sep 15 09:16:32 ovz1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 15 09:16:33 ovz1 systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument
Sep 15 09:16:33 ovz1 systemd[1]: Started A high performance web server and a reverse proxy server.
Help find a solution to the problem. I already googled everything I could, nothing helped.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Mukovoz, 2017-09-15
@castomi

if you just run gunicorn --bind pystart.ru:8000 firstapp.wsgi
then everything works.

Why aren't you launching? Nginx only proxies if there is something to proxy, and if not, it will show 502 or 504.

D
Dimonchik, 2017-09-15
@dimonchik2013

https://djbook.ru/examples/62/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question