Nginx stopped working

I stopped the nginx using command then tried to start again. but it shows error. Can anyone please help me ?

also my website domain is showing nginx when nginx is active. But the website is not showing. I tried to install SSL using article.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


There is a syntax error on line 4 in the /etc/nginx/sites-enabled/ file. You need to open the file with your favorite text editors like nano or vim and update the line to fix the syntax or remove the line in case that it is not needed.

After that, you could restart Nginx again.

I always recommend testing your Nginx config syntax before restarting Nginx, you can do this with:

sudo nginx -t

And only if you get Syntax OK, then you could restart Nginx. That way you minimize the downtime.

Regards, Bobby