Question

Nginx Warnings - How to fix?

  • Posted April 29, 2016
  • Nginx

Hey!

When I I try to restart nginx, after editing sudo nano /etc/nginx/sites-available/default, I get this fail response:

Restarting nginx nginx [fail]

I then do nginx -t and get this message:

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2016/04/28 20:06:07 [warn] 6121#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2016/04/28 20:06:07 [emerg] 6121#0: unexpected "}" in /etc/nginx/sites-enabled/default:84
nginx: configuration file /etc/nginx/nginx.conf test failed

So what am I doing wrong and how can I fix it? It seems there is two things going wrong?

Thanks in advance.

Subscribe
Share

Hi,

What happens if you do sudo nginx -t ?

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2016/04/28 20:18:01 [warn] 6275#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2016/04/28 20:18:01 [emerg] 6275#0: open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

NEW MESSAGE


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

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.

When running nginx -t and attempting to start/restart nginx were you using sudo?

Have you changed the default user and group that nginx runs under?

This comment has been deleted