S
S
Slash2018-09-03 15:24:35
Nginx
Slash, 2018-09-03 15:24:35

How to disable adding a specific error to the log?

Hello.
Blocked access to the site by IP: How to block an IP range in Nginx? now the log "/var/www/httpd-logs/site.error.log" is full of messages:

2018/09/03 15:13:43 [error] 9215#9215: *15918 access forbidden by rule, client: 141.8.142.114, server: site, request: "GET /page/url/ HTTP/1.1", host: "site"

What can be done so that these errors are not written to the log, while other errors are kept?
Thanks to.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Slash, 2018-09-04
@Slash-Zn

In the Nginx konig, where the path of the log file is specified, add crit : Now these errors are not recorded. The error log will only keep critical errors.

S
Swartalf, 2018-09-03
@Swartalf

in the desired location:
access_log off;
error_logoff;
ngx_http_log_module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question