Friday, January 29, 2016

nginx - empty logs on ubuntu

nginx won't either reload nor restart unless the complete ngix configuration is 100% correct!

It will simply ignore the nginx -s reload command (and possibly throw an error line).


For example, when I was trying to reload the config file, I've encountered this line:

nginx: [emerg] getgrnam("web") failed in /etc/nginx/nginx.conf:7



It is a very important message, because when I fixed it (by changing user web with user web www-data in my nginx.conf , line 7), nginx reloaded without any errors!


UPDATE:

It's not enough that nginx -s reload goes ok.

You also should make sure that nginx -t is successful.

Also, full settings reload is achieved by nginx -s reload && nginx -s reopen (reopens log files).

In case your log files are not being generated, it's probable that nginx -t fails for some reason. Since, it's just an  interpreter, any further action in setup will be discarded.

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...