I found it helpful to approach nginx debugging with the following steps:
1 ... Make sure nginx is running.
ps aux | grep nginx
2 ... Check the processes already associated with this port.
lsof -n -i:80
3 ... Make sure nginx has rebooted.
sudo nginx -t sudo nginx -s reload
On a Mac, brew services restart nginx not enough to restart Nginx.
4 ... Try creating simple answers manually to make sure the path to your location is not confused. This is especially useful when problems arise when using proxy_pass to forward requests to other running applications.
location / { add_header Content-Type text/html; return 200 'Here I am!'; }
spencer.sm Nov 04 '18 at 4:11 2018-11-04 04:11
source share