access.log not updating
December 17, 2019 10:13AM
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.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 300
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready