1

I have defined in my server block

location = /wp-login.php {deny all;access_log off;log_not_found off;}

However I am still seeing error messages being logged:

2018/11/03 19:00:53 [error] 6477#6477: *33405 access forbidden by rule, client: xxx216.150, server: , request: "GET /wp-login.php HTTP/1.1", host: "domain.com"
Host: domain  Name: /var/log/nginx/error.log 

How could I remove these messages from spamming the error.log ?

1 Answer 1

2

From the client's perspective, a solitary deny all; is effectively the same as a return 403;, but without the "access forbidden by rule" error message.

For example:

location = /wp-login.php {
    return 403;
    access_log off;
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .