I'm trying to get nginx to log access and error logs. My logs currently have very old content, a mix of logs and gzipped logs.
$ ls -la access*.log*
-rw-rw-rw- 1 nobody nogroup 0 Jan 8 2016 access.log
-rw-rw-rw- 1 nobody nogroup 2261400 Jan 7 2016 access.log.1
-rw-rw-rw- 1 nobody nogroup 311947 Dec 30 2015 access.log.10.gz
-rw-rw-rw- 1 nobody nogroup 434744 Dec 29 2015 access.log.11.gz
My configuration is:
user www-data www-data;
error_log /var/log/nginx/error.log info;
...
http {
access_log /var/log/nginx/access.log combined;
...
Strangely, despite the user
declaration the worker processes still run as nobody:
# ps -eo "%U %G %a" | grep nginx
root root nginx: master process /usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf
nobody nogroup nginx: worker process
nobody nogroup nginx: worker process
I tried setting the owner of the existing access.log
and error.log
files to be nobody:nogroup
but still it doesn't log anything.
There's nothing (relevant) in syslog
.
I have tried a mixture (!) or reloading and restarting nginx after changing the configuration file. Still nothing...
How is my configuration incorrect?