Question

Do I need Nginx? Is this error I got a problem?

It sounds like I need nginx to make my server available to the public but im not sure. And is it supposed to be installed on the same droplet as everything else?

I am following this guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#manage-application-with-pm2

I got this error when doing the first step: http://pastebin.com/aVbf60zE

Then when I try to edit “default server block configuration file” it comes up blank, and when I try to save it, it says no such file or directory.

I do get “Welcome to nginx!” in my browser.

I do not see an nginx folder in /etc/ so I’m not sure it installed to the right place.

Show comments

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.

Did you created a new server block file instead of default? If yes, you should delete default from /etc/nginx/sites-enabled and symlink new one to it:

  1. sudo ln -s /etc/nginx/sites-available/your-block /etc/nginx/sites-enabled/

You can test configuration so you see is it correct:

  1. sudo nginx -t

Make sure you restart nginx after symlinking or doing any other change to block:

  1. sudo systemctl restart nginx

I would clean up browser cache just to be sure. E.g. On Chrome you can use Ctrl+Shift+R to Hard Reload, or fire up console with F12, right click on refresh button and select Empty Cache and Hard Reload.