+3 votes
in Web & Google by (71.8k points)

To disable access_log created by Nginx, I added 'access_log off;' after 'error_log /var/log/nginx/error.log warn;'

access_log off;

error_log /var/log/nginx/error.log warn;

But I am getting error : "access_log" directive is not allowed here in /etc/nginx/nginx.conf"

How to fix it?

1 Answer

+1 vote
by (349k points)
edited by
 
Best answer

Did you write "access_log off" inside http?  To disable access_log and error_log, you need to have "access_log off" and "error_log off" inside http.

  http {

          access_log off;

          error_log off;

       }

Related questions


...