Disable Nginx logs completely

My computer develop environment

$ cat /etc/issue
Ubuntu 14.04 LTS

Open the “nginx.conf” file (usually located : /etc/nginx folder) or the Nginx config file for a particular site, for which you wish to turn off nginx logs (usually located in : /etc/nginx/sites-available folder).

Find the line :

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

Some people simply change the line to the following :

error_log    off;

Please note that this will not stop the nginx logs from being created on the server.
This will just create the logs in : “/usr/share/nginx/off” file.

If you wish to turn off the Nginx error logs completely, you need to change the line to :

error_log   /dev/null   crit;

This will completely turn off the Nginx error logs on your server.

# nginx

Thank you for reading.
This post is copyrighted by Liyuliang’s Blog.
If reproduced, please indicate the source: Liyuliang’s Blog
This blog uses Creative Commons Attribution-NonCommercial-Share-Sharing 4.0 International License Agreement to license.

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now