Suppress nginx access denied error log

2019-06-17 03:25发布

问题:

I have some rules setup in nginx to deny access by IPs. This works great, but for each request from a denied IP, an error that starts with the following gets logged:

[error] 7325#0: *5761 access forbidden by rule, client...

Is there a way to suppress these "errors" from being logged?

回答1:

You can set error_log to less strict level, but you can lost important alerts in this case.

Core functionality - error_log

error_log filename crit;


标签: logging nginx