如果不想要積累太多 nginx log意鲸,直接點禁掉 log,或者 rotate log 見上文此叠。
全局禁掉 error_log 很簡單:
error_log /dev/null crit;
禁掉 access_log 不能在全局做自晰,會提示:
nginx: [emerg] "access_log" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:7
所以需要在 server 下搞:
access_log off;