Disable 404 error logging

In my configuration, I use:

error_page 404 /switch; 

When I look through / testABC, I see this error in my log:

 open() "/usr/local/nginx/html/www/testABC" failed (2: No such file or directory) 

How to disable this error? I am currently using 404 as part of the functionality of the site.

+8
nginx
source share
1 answer

If you do not want 404 errors displayed in your nginx error log_not_found , log_not_found is the directive you want to configure.

By default, the log_not_found parameter log_not_found set to "on", which reports on errors not found in your main error log. To disable them, simply do:

 log_not_found off; 

Source: http://nginx.org/en/docs/http/ngx_http_core_module.html#log_not_found

+32
source share

All Articles