Question
502 Bad Gateway Django Nginx Gunicorn
I’m trying to run a django website on a server through nginx and gunicorn. I followed these instructions to get setup but I’m receiving a bad gateway error when I google my ip. If anyone can help thanks so much! Best, Evvan
Also when I do status of nginx and gunicorn I get:
derians@myCodingBlog:~$ sudo systemctl status nginx
[sudo] password for derians:
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-01-03 23:50:52 UTC; 15h ago
Main PID: 28998 (nginx)
Tasks: 2
Memory: 2.1M
CPU: 163ms
CGroup: /system.slice/nginx.service
|-28998 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
`-28999 nginx: worker process
Jan 03 23:50:52 myCodingBlog systemd[1]: Stopped A high performance web server and a reverse proxy server.
Jan 03 23:50:52 myCodingBlog systemd[1]: nginx.service: Unit entered failed state.
Jan 03 23:50:52 myCodingBlog systemd[1]: nginx.service: Failed with result ‘timeout’.
Jan 03 23:50:52 myCodingBlog systemd[1]: Starting A high performance web server and a reverse proxy server…
Jan 03 23:50:52 myCodingBlog systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
Jan 03 23:50:52 myCodingBlog systemd[1]: Started A high performance web server and a reverse proxy server.
derians@myCodingBlog:~$ sudo systemctl status gunicorn
gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2017-01-04 00:50:22 UTC; 14h ago
Main PID: 29271 (code=exited, status=203/EXEC)
Jan 04 00:50:22 myCodingBlog systemd[1]: Started gunicorn daemon.
Jan 04 00:50:22 myCodingBlog systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC
Jan 04 00:50:22 myCodingBlog systemd[1]: gunicorn.service: Unit entered failed state.
Jan 04 00:50:22 myCodingBlog systemd[1]: gunicorn.service: Failed with result 'exit-code’.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
I have exactly the same issue, did you find a solution ?