Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress nginx access denied error log

Tags:

logging

nginx

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?

like image 478
Andrew Frankel Avatar asked Sep 10 '14 19:09

Andrew Frankel


1 Answers

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;
like image 59
Aleksey Deryagin Avatar answered Oct 23 '22 06:10

Aleksey Deryagin