Nginx 502 Bad Gateway - Django.
1. Check If Gunicorn Service Working Properly
a) Check If this is active or not:
● servicename.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/servicename.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-02-02 08:07:09 UTC; 1 months 12 days ago
If this is active you can go to 2 step
b) If you got any error:
Most Chances of getting an error of gunicorn installed dir
First Activate your env:
Check gunicorn installed dir:
Copy output of this command and open your gunicorn config:
Now Find the line ExecStart and cut the path which is linked to gunicorn and paste the path you have copied and exit nano
Restart Service:
Check status :
It may be active, it's fixed...