Knowledgebase

How to Protect Nginx Against DDoS and Brute-Force with Rate Limiting Print

  • 0

Throttle abusive bots and login flood requests directly at the Nginx layer.

Step-by-Step Instructions

  1. Define a limit_req_zone in nginx.conf inside the http block.
  2. Apply limit_req inside sensitive locations like /login or /wp-login.php.
  3. Reload Nginx to activate protection.
limit_req_zone $binary_remote_addr zone=login_limit:10m rate=5r/m;
location /wp-login.php {
  limit_req zone=login_limit burst=5 nodelay;
}

Pro Tip: Combine Nginx rate limiting with Cloudflare Under Attack Mode during severe floods.

Need assistance? Open a ticket in the A1 Client Area or contact our 24/7 NOC Engineering Team on WhatsApp at +1 (406) 229-9597.


Was this answer helpful?

« Back