如何真正完全关闭 nginx 日志

如果你在 nginx 配置中使用如下语句

nginx_conf_example.conf
access_log off;
error_log off;

不会真正关闭日志。它只会将日志写入 /usr/share/nginx/off

要真正关闭日志,使用

nginx_conf_devnull.conf
access_log /dev/null;
error_log /dev/null;

Check out similar posts by category: Nginx