A couple of years ago I set up four websites on a nginx server, recently I ran into SQL troubles and decided to rebuild site 1 which ran the SQL backend. However, ever since I am running into a persistent 502 voor site 1 which I can't seem to get a hold of.
Initially I was running into port issues but this does not seems to be fixed after running through; nginx - nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
At this point I am stil stuck with a: connect() failed (111: Connection refused) while connecting to upstream, client: 01.01.01.100, server: www.site1.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5001/", host: "site1.com"
in the nginx error.log.
Could someone give me a push in the right direction?:(
I don't have a webdev background, my focus is on scientific research through Python and I like to play around with HTML/CSS etc. Server management isn't my cup of tea I'm afraid :(.
Edit 1;
netstat -ln4t
displays:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:5002 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5003 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5004 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
Am I correct in thinking this means :5001 is not up and running?
Edit 2:
Alright, next step. Nginx calls on four seperate Gunicorn sockets (@ /etc/systemd/system
) , one for each site, which in turn calls on individual Django backends (site 1 socket is comparable with site 2 socket).
Running:
sudo systemctl status site1.gunicorn
Results in:
Active: failed (Result: exit-code) since Sun 2022-03-20 11:23:40 UTC;
*techbabble*
Main PID: 23301 (code=exited, status=1/FAILURE)
*techbabble*
Mar 20 11:23:40 site1.com systemd[1]: Failed to start Gunicorn daemon
It seems I am onto something!
sudo systemctl deamon-reload
sudo systemctl restart site1.gunicorn
sudo systemctl status site1.gunicorn
Again, a step further, the socket (?) is up! Through the 502 is still persisting, turning off and on nginx didn't solve this.