---
title: "Rate limits"
description: "Count each client IP's matching requests over 60, 300 or 600 seconds, and block or log a client over the limit."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate limits

A `rateLimit` rule counts the requests that match its conditions, per client IP. A client over the
limit is blocked (`403`) until its count in the window falls back under the limit. Requests under the
limit carry on to the next rule.

```json
{
  "name": "login",
  "action": "rateLimit",
  "mode": "block",
  "rateLimit": { "limit": 20, "windowSeconds": 300 },
  "conditions": [
    { "type": "equals", "negate": false, "target": "path", "value": "/login", "caseSensitive": false },
    { "type": "equals", "negate": false, "target": "method", "value": "POST", "caseSensitive": false }
  ]
}
```

| Field | |
| --- | --- |
| `rateLimit.limit` | 1 to 100,000 requests |
| `rateLimit.windowSeconds` | `60`, `300` or `600` |
| `mode` | `block` (the default), or `log` to record clients over the limit without blocking them |

- To count every request, use a condition that always matches, such as `path` `regex` `^/`.
- Counting is per client IP. Clients behind one address, such as an office's network, share a count.
- A rate limit can't have a `body` condition, or come after a rule that has one.

Set a new limit's `mode` to `log` first, check in the [logs](/waf/logging) which clients go over, then
change it to `block`. See [Rate limit a login page](/waf/guides/rate-limit-a-login-page).

Source: https://docs.ezghcloud.com/waf/rate-limits/index.mdx
