Nginx Rate Limiting

Nginx web server support rate-limiting with module ngx_http_limit_req_module.

Block WordPress wp-login.php attack

To block the WordPress wp-login.php attack, add the following to http section of your nginx.conf file.

limit_req_zone $binary_remote_addr zone=WPRATELIMIT:10m rate=2r/s;
limit_req_status 429;

2r/2 = Lmit 2 requests per second.

Advertisement

Inside server entry for the website, add

location ~ \wp-login.php$ {
    limit_req zone=WPRATELIMIT;
    include snippets/fastcgi-php.conf;
}
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement