禁止Nginx访问被拒绝的错误日志 [英] Suppress nginx access denied error log
本文介绍了禁止Nginx访问被拒绝的错误日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在nginx中设置了一些规则来拒绝IP访问.这很好用,但是对于来自拒绝的IP的每个请求,都会记录以以下内容开头的错误:
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?
推荐答案
您可以将error_log设置为不太严格的级别,但是在这种情况下,您可能会丢失重要的警报.
You can set error_log to less strict level, but you can lost important alerts in this case.
error_log filename crit;
这篇关于禁止Nginx访问被拒绝的错误日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文