All of the sudden when restarting Nginx I get the following error:

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

On the front end part of the site loads but some files such as the CSS in particular are not loading. They exist on the server but when loading the resources directly in Chrome they say "Oops this page can't be found."

I set a special group and user to run my apache files using suexec for my domain files. I think the nginx are owned by root however which I'm assuming is the problem but which nginx file ownerships would I change?


Or, you can change the nginx.log file permissions so they match your current user which you use to start nginx:

chown your_user /var/log/nginx/error.log

I suggest you add this permisions to the entire nginx log dir

chown -R your_user /var/log/nginx/

Just start the nginx as the root user or using sudo

$>sudo /etc/init.d/nginx start

$>sudo service nginx start

Not sure on which operative system you are. Set the user owner in your nginx.conf http://forum.nginx.org/read.php?11,2664

  • Dheivame ye kadavule... realy your answer helped me alot :) Thanks – Abhiram Oct 6 '14 at 21:44

The nginx master process has root permissions but Amplify-agent periodically performs the command 'nginx -t' by a non-root user. That is the reason for these errors in the error.log

So, you may just ignore these errors.

Check by comparing output from, "sudo nginx -t"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.