Suppress nginx access denied error log

2019-06-17 02:30发布

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?

标签: logging nginx
1条回答
Rolldiameter
2楼-- · 2019-06-17 03:35

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;
查看更多
登录 后发表回答