Question

im getting below error when try to start the nginx

Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Sat 2018-06-16 10:02:39 UTC; 13s ago
Process: 30246 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE) Process: 30245 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS) Main PID: 1665 (code=exited, status=0/SUCCESS)
Jun 16 10:02:39 ip-172-17-247-243.atom.sbx.loc systemd[1]: Starting The nginx HTTP and reverse proxy server… Jun 16 10:02:39 ip-172-17-247-243.atom.sbx.loc nginx[30246]: nginx: [emerg] open() “/etc/nginx/nginx.conf” failed (13: Permission denied) Jun 16 10:02:39 ip-172-17-247-243.atom.sbx.loc nginx[30246]: nginx: configuration file /etc/nginx/nginx.conf test failedcode


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.

Hello,

It looks like that you might have an error in your Nginx config file. To test that you could run the following:

sudo nginx -t

Also when you try to restart Nginx, make sure to use sudo as well unless you are logged in as root.

Regards, Bobby