Hi,
My website has been running since I deployed it yesterday.
I rebooted the server this morning, and now the website won’t load.
Im using nginx and gunicorn - i have tested both and the tests were successful.

What reasons are there that the website now wont load, after nothing was changed during the reboot

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.

×
1 answer

502 Bad Gateway means nginx is unable to communicate to gunicorn.

Make sure that gunicorn is running on the expected port. You can verify it using :

netstat -tulpn

If you find it running and the website still shows 502, try restarting nginx and gunicorn.

Let me know if you have any further questions.

  • I can’t see gunicorn in the table (posted below), i’m assuming that’s the issue? It’s strange as when I run sudo systemctl status gunicorn.socket, it says gunicorn is active

    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1849/nginx: master
    tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 718/systemd-resolve
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 997/sshd
    tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1037/postgres
    tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1849/nginx: master
    tcp6 0 0 :::80 :::* LISTEN 1849/nginx: master
    tcp6 0 0 :::22 :::* LISTEN 997/sshd
    udp 0 0 127.0.0.53:53 0.0.0.0:* 718/systemd-resolve

Submit an Answer