My nginx shows that theres an error but the website works fine

Posted October 18, 2021 98 views
NginxUbuntu 20.04

as i was installing ssl certificate with certbot, the nginx worked just fine, but after that when I am trying to restart nginx it shows this issue.
i tried to re-install nginx but.. the same problem,
again - the website works fine with pm2 running the node js server.

the error

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


I would recommend checking your Nginx error log to see what errors have been logged:

tail -100 /var/log/nginx/error.log

Also I would recommend checking if there are any other services listening on port 80:

netstat -plant | grep 80

In case that you have any other services listening on that port like Apache, for example, you would need to stop them first before you could start Nginx. Note you can not have more than 1 service listening on the same port.

As a side note, for more information, I would recommend checking this answer here that includes some more tips:

Let me know how it goes.