Nginx running but not serving
You can verify whether nginx is running and binding to port 80 with something like lsof
and/or fstat
:
Here's fstat
on OpenBSD:
% fstat -u www | fgrep "*:"www nginx 21404 82* internet stream tcp 0xfffffe833a10d250 *:80www nginx 21404 83* internet6 stream tcp 0xfffffe833a10d480 *:80
Here's lsof
on GNU/Linux:
% lsof -i -n | fgrep nginxnginx 24854 root 6u IPv4 61955031 0t0 TCP *:http (LISTEN)nginx 25047 nobody 6u IPv4 61955031 0t0 TCP *:http (LISTEN)
Also, per https://serverfault.com/a/870709/110020, I would recommend against using the sites-available
/sites-enabled
, as it may also be giving you the extra hassles.
The next step would be to run curl -v
from within the box where nginx is running, and/or involve tcpdump
to try to find where the packets are getting lost — perhaps you have a firewall in place? Do you get any reply from nginx at all? Is it perhaps your backend that's unavailable?