im getting below error when try to start the nginx

Posted June 16, 2018 3.3k views

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/ (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

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


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.