How to disable NGINX logging on Linux system - LinuxConfig.org


#1
The default configuration of Nginx webserver logging system is to log both access and error logs for all enabled sites into /var/log/nginx/access.log and /var/log/nginx/error.log respectively. This default behaviour is set by the following directives found within /etc/nginx/nginx.conf configuration file:
This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-disable-nginx-logging-on-linux-system

#2

Chupaka

Actually, that works with access_log, but error_log off; writes the log to file named ‘off’. So “error_log /dev/null” does the trick.


#3

kotarou

acturelly, this is wrong, nging will write log into a file called off
you should redirect access_log to /dev/null