Rate Limiting — limit request rates
Rate limiting blocks or slows down a client that sends too many requests within a period of time. VNIS uses a token bucket algorithm: each client has a "bucket" of tokens, each request uses 1 token, the bucket refills at requests_per_second, and burst_size allows the limit to be exceeded briefly.
Use it to protect a login API from password guessing, to prevent scraping, and to prevent abuse of resource-heavy endpoints. Example: bots are trying 1,000 passwords per minute on your login form — set a rule of 100 requests per minute per IP for /api/login.
Before you start
- The domain has been added and points to VNIS.
- If you want to limit by JA4 (TLS fingerprint), you must first turn on WAF JA4 in the WAF tab (otherwise you get an error when saving).
How to configure
- Go to Domains → select a domain → Rate Limit tab.

- Turn on Enabled. Choose a default limit for the whole domain (or leave it empty and use only path rules in the next step). If it is not enabled, the form shows the message Rate limiting is OFF: clicking Create/Save at this point only saves the configuration in the off state, and nothing is applied yet.
- Click Add rule to add a path rule.
- Set Match path, Requests per second, Window, Burst, and choose an Action.
- Click Save and wait a few seconds for it to sync.
Configuration fields
Domain level (default):
| Field | Meaning | Values | Default | Notes |
|---|---|---|---|---|
| Enabled | Turns rate limiting on for the domain | On/off | Off | When on, you must have rps > 0 or at least 1 rule, otherwise an error is shown |
| Requests per second | Number of requests allowed per second | 0 – 1,000,000 | 0 | — |
| Window | Counting window | Seconds: 0 (per second) or 5–86400 | 0 | Values 1–4 are not valid |
| Burst size | Short-term overage allowed | 0 – 1,000,000 | 0 | — |
| By IP | Count per IP address | On/off | On | Turning off keying by the requested URL requires By IP = on |
| By host | Count per hostname | On/off | Off | — |
| Bypass IPs | Exempt IPs/CIDRs | List of CIDRs | — | CIDRs broader than v4 /8 or v6 /16 are rejected |
Each path rule:
| Field | Meaning | Values | Default | Notes |
|---|---|---|---|---|
| Name | Rule name | ≤128 characters, unique | — | No control characters, no [ ] |
| Enabled | Turns the rule on | On/off | On | When on, rps > 0 |
| Match path | Path the rule applies to | Glob (for example /api/login*) | — | Required |
| Priority | Priority | Integer | 0 | Lower numbers run first; evaluation stops at the first matching rule |
| Requests/sec, Window, Burst | Same as domain level | Window 0 = inherit, or 5–86400 | ||
| By JA4 | Count per TLS fingerprint | On/off | Off | WAF JA4 must be turned on first, otherwise saving fails with 400 |
| Vouch window | "Vouch" window | 0 or 30–3600 seconds | 0 | Only used when By IP = off |
| Action | Action when the limit is exceeded | See below | ""(=429) | |
| Block duration | Block duration (for timed_block) | 10 – 604800 seconds | — | Required when Action = timed_block |
Action — which ones you can use:
| Action | Meaning | Status |
|---|---|---|
"" or 429 | Returns 429 Too Many Requests + Retry-After | Available |
timed_block | Blocks the client (403) for block_duration | Available (requires By IP = on) |
challenge (the "JS Challenge (Managed)" option) | JavaScript challenge instead of 429 | Available when the JS Challenge is enabled for your account (see Action JS Challenge (Managed)). Otherwise, the rule is inert and clients over the limit receive a normal 429 |
Note: timed_block and challenge require By IP = on.
Action JS Challenge (Managed)
When a client exceeds the limit, instead of returning 429 right away, the edge returns a JavaScript challenge page for browser page navigations. A browser that passes receives a clearance and continues to be admitted — it is still counted for rate limiting. How the mechanism works: JS Challenge.
- By IP is required — the form turns on By IP automatically when you choose JS Challenge (warning "Block, Timed Block and JS Challenge actions require "By IP"").
- Clients that cannot run JS (APIs, native apps, requests that are not page navigations) always receive a normal 429. Rate Limit does not have a Block/Allow fallback option like Firewall does.
- Default values come from Bot Challenge → "JS Challenge defaults".
- When JS Challenge is not enabled for your account: you cannot create new challenge rules (or change other rules to challenge); existing rules can still be edited or turned off, show an inert badge, and return a normal 429.
Steps:
- Add rule → turn on By IP → under Action when rate limit exceeded, choose JS Challenge (Managed).
- Adjust JS Challenge display (this rule) (Domain default / Interstitial / Transparent), Redirect delay (seconds) (0–10, Interstitial only), and Clearance TTL (minutes) (empty = inherit the domain default, or 1–1440).

- Click Save. The rule list shows a summary of the settings (for example
Interstitial · TTL 10 min) and an inert badge when JS Challenge is not enabled for your account.
Configuration examples
Example 1 — Limit the login API to 100 requests per minute.
- Match path:
/api/login*· By IP: on · Requests/sec: not used directly — set Window = 60; the total number of requests allowed per window =rps× window. The simplest approach: Window60, with Requests/sec set to give about 100 per minute (≈ 2 per second) plus a small Burst; or setrpsto suit your needs and fine-tune it. - Action:
429(ortimed_blockfor 300s if you want to penalize password guessers more heavily). - Result: an IP that sends more than about 100 requests per minute to
/api/loginreceives 429. - Check: run
for i in $(seq 1 120); do curl -s -o /dev/null -w "%{http_code}\n" https://domain/api/login; done→ 429 appears once the limit is exceeded.
Example 2 — Prevent scraping: 10 requests per second per IP for the whole site.
- Leave the path empty (use the domain level) or use Match path
/*. By IP: on · Requests/sec:10· Window0· Burst20. - Result: each IP that exceeds about 10 requests per second receives 429.
- Check: send requests quickly with
ab/curl→ 429 appears.
Example 3 — Temporarily penalize abuse of /search.
- Match path
/search*· By IP on · Requests/sec5· Actiontimed_block· Block duration600. - Result: an IP that exceeds the limit is blocked with 403 for 10 minutes.
- Check: exceed the limit → you receive 403 with Retry-After; you can only access the site again after 600s.
Order of evaluation
- Path rules: lower priority numbers run first, and evaluation stops at the first matching rule.
- The Access Control (allow) and verified bot layers run before rate limiting — if an IP or bot is allowed, it skips rate limiting (see the Access Control article: an
allowrule bypasses everything). - Rate limiting runs before the WAF; a client that receives 429 does not continue to the WAF.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Saving returns a 400 "window" error | Window set to 1–4 | Use 0 or ≥5 |
| By JA4 is on but saving fails | WAF JA4 is not on | Turn on WAF JA4 in the WAF tab and save again |
| Nothing is blocked | A rule with a higher priority number is overshadowed by another rule, or the IP is in Bypass IPs | Check the priority order and the bypass list |
| Turning on Enabled shows an error | rps=0 and there are no rules | Set rps>0 or add at least 1 rule |
| You cannot select or save JS Challenge, or the rule has an inert badge (only 429 is returned) | JS Challenge is not enabled for your account | Contact VNETWORK support; the rule is kept and starts working once JS Challenge is enabled |
| A JS Challenge rule, but the API/app only receives 429 | Working as designed — clients that cannot run JS always receive 429 | No action needed; use Token V2 if you want to protect an API |
FAQ
- Is counting per IP or per user? Per IP (or JA4). It does not count per logged-in account.
- What status code does a blocked client receive?
429(rate limited) or403(timed_block), withRetry-After. - Can I exempt my company office? Yes. Add its IP range to Bypass IPs (remember: no broader than /8 for IPv4 or /16 for IPv6).
- Are upload limits different from request limits? Yes. The same tab also has settings for the maximum request body size and the minimum/maximum upload rate (413/408/429).