P
P
Peter2016-11-02 14:33:31
Nginx
Peter, 2016-11-02 14:33:31

Why doesn't nginx write access_log?

Good afternoon, it is necessary that nginx writes a general access_log, I insert a line into the http

section The corresponding file is created but remains empty Inside the server section I insert a similar line - the site log for which this section is responsible is written (it should be so) And when I insert a similar line inside the http section then the log file is created but it is empty. O.S. Debian 8.6 has enough file permissions, space too, on another Debian 7 machine, the same construct works.
access_log /var/www/httpd-logs/traf.access.log;






Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2016-11-02
@opium

In all servers, you have removed the access log option, I hope

W
webvalman, 2020-10-12
@webvalman

The author of the post probably already found the answer. But it will be useful for future generations.
I ran into this same problem and spent a fair amount of time until I found that the problem was with SELinuxe and its useful security policy.
In short, you need to add the necessary context to the directory so that Nginx can write logs there. I wrote more about the
solution at i.valman.org/2020/10/nginx-centos-selinux.html words and one comment do not lay down the whole meaning of the actions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question