nginx not listening to port 80 nginx not listening to port 80 nginx nginx

nginx not listening to port 80


I had this same problem, the solution was that I had not symlinked my siteconf file correctly. Try running vim /etc/nginx/sites-enabled/mysite.com—can you get to it? I was getting "Permission Denied."

If not run:

rm /etc/nginx/sites-enabled/mysite.comln -s /etc/nginx/sites-available/mysite.com /etc/nginx/sites-enabled/mysite.com


If your logs are silent on the issue, you may not be including the sites-enabled directory. One simple way to tell that the site is being loaded is to set the error/access log path within your server block to a unique path, reload nginx, and check if the files are created.

Ensure the following include directive exists within the http context in /etc/nginx/nginx.conf.

http {  ...  include /etc/nginx/sites-enabled/*;}


I've found it helpful to approach debugging nginx with the following steps:

1... Make sure nginx is running.

ps aux | grep nginx

2... Check for processes already bound to the port in question.

lsof -n -i:80

3... Make sure nginx has been reloaded.

sudo nginx -tsudo nginx -s reload

On Mac, brew services restart nginx is not sufficient to reload nginx.

4... Try creating simple responses manually to make sure your location path isn't messed up. This is especially helpful when problems arise while using proxy_pass to forward requests to other running apps.

location / {    add_header Content-Type text/html;    return 200 'Here I am!';}