I have setup an nginx instance as a tcp proxy running version 1.16.1.
The configuration is working fine apart from the access.log is not updating. It stays at 0 bytes.The error.log in the same folder is updating ok?
I have tried the following:
- deleting the access log (the file reappears as 0 bytes after restart or reload)
- Change the permissions to specify the user and group "nginx" as the owner (the file changes to be owned by root after reload/restart)
- Confirmed there is no access_log off in the nginx.conf
I have also tried adding an access_log configuration to the server entry but the config fails as it complains that a log_format is needed (the docs suggest it shouldn't be and that the combined one should apply). If I specify the log_format specified in the main nginx.conf, it still fails saying a log_format is needed.
ps -eo "%U %G %a" | grep nginx
=======================
root root nginx: master process /usr/sbin/nginx
nginx nginx nginx: worker process is shutting down
nginx nginx nginx: worker process
nginx nginx nginx: worker process
log file size and permissions:
=======================
-rw-r--r--. 1 root root 0 Dec 17 15:57 access.log
-rw-rw-r--. 1 nginx nginx 2421 Dec 17 16:08 error.log
nginx.conf access log entries:
=======================
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
Any help greatly appreciated.
The configuration is working fine apart from the access.log is not updating. It stays at 0 bytes.The error.log in the same folder is updating ok?
I have tried the following:
- deleting the access log (the file reappears as 0 bytes after restart or reload)
- Change the permissions to specify the user and group "nginx" as the owner (the file changes to be owned by root after reload/restart)
- Confirmed there is no access_log off in the nginx.conf
I have also tried adding an access_log configuration to the server entry but the config fails as it complains that a log_format is needed (the docs suggest it shouldn't be and that the combined one should apply). If I specify the log_format specified in the main nginx.conf, it still fails saying a log_format is needed.
ps -eo "%U %G %a" | grep nginx
=======================
root root nginx: master process /usr/sbin/nginx
nginx nginx nginx: worker process is shutting down
nginx nginx nginx: worker process
nginx nginx nginx: worker process
log file size and permissions:
=======================
-rw-r--r--. 1 root root 0 Dec 17 15:57 access.log
-rw-rw-r--. 1 nginx nginx 2421 Dec 17 16:08 error.log
nginx.conf access log entries:
=======================
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
Any help greatly appreciated.