Skip to main content

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​

  1. Go to Domains → select a domain → Rate Limit tab. Go to Domains → select a domain → Rate Limit tab
  2. 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.
  3. Click Add rule to add a path rule.
  4. Set Match path, Requests per second, Window, Burst, and choose an Action.
  5. Click Save and wait a few seconds for it to sync.

Configuration fields​

Domain level (default):

FieldMeaningValuesDefaultNotes
EnabledTurns rate limiting on for the domainOn/offOffWhen on, you must have rps > 0 or at least 1 rule, otherwise an error is shown
Requests per secondNumber of requests allowed per second0 – 1,000,0000—
WindowCounting windowSeconds: 0 (per second) or 5–864000Values 1–4 are not valid
Burst sizeShort-term overage allowed0 – 1,000,0000—
By IPCount per IP addressOn/offOnTurning off keying by the requested URL requires By IP = on
By hostCount per hostnameOn/offOff—
Bypass IPsExempt IPs/CIDRsList of CIDRs—CIDRs broader than v4 /8 or v6 /16 are rejected

Each path rule:

FieldMeaningValuesDefaultNotes
NameRule name≤128 characters, unique—No control characters, no [ ]
EnabledTurns the rule onOn/offOnWhen on, rps > 0
Match pathPath the rule applies toGlob (for example /api/login*)—Required
PriorityPriorityInteger0Lower numbers run first; evaluation stops at the first matching rule
Requests/sec, Window, BurstSame as domain levelWindow 0 = inherit, or 5–86400
By JA4Count per TLS fingerprintOn/offOffWAF JA4 must be turned on first, otherwise saving fails with 400
Vouch window"Vouch" window0 or 30–3600 seconds0Only used when By IP = off
ActionAction when the limit is exceededSee below""(=429)
Block durationBlock duration (for timed_block)10 – 604800 seconds—Required when Action = timed_block

Action — which ones you can use:

ActionMeaningStatus
"" or 429Returns 429 Too Many Requests + Retry-AfterAvailable
timed_blockBlocks the client (403) for block_durationAvailable (requires By IP = on)
challenge (the "JS Challenge (Managed)" option)JavaScript challenge instead of 429Available 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:

  1. Add rule → turn on By IP → under Action when rate limit exceeded, choose JS Challenge (Managed).
  2. 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). Add Rate Limit Rule modal: action "JS Challenge (Managed)" selected, By IP on, the JS Challenge display (this rule), Redirect delay (seconds) and Clearance TTL (minutes) settings; note "Clients that cannot run JS … get the normal 429"
  3. 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. Rate Limiting rule list: a JS Challenge rule shows its display mode and TTL summary, with an "inert" badge when JS Challenge is not enabled

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: Window 60, with Requests/sec set to give about 100 per minute (≈ 2 per second) plus a small Burst; or set rps to suit your needs and fine-tune it.
  • Action: 429 (or timed_block for 300s if you want to penalize password guessers more heavily).
  • Result: an IP that sends more than about 100 requests per minute to /api/login receives 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 · Window 0 · Burst 20.
  • 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/sec 5 · Action timed_block · Block duration 600.
  • 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 allow rule bypasses everything).
  • Rate limiting runs before the WAF; a client that receives 429 does not continue to the WAF.

Troubleshooting​

SymptomCauseFix
Saving returns a 400 "window" errorWindow set to 1–4Use 0 or ≥5
By JA4 is on but saving failsWAF JA4 is not onTurn on WAF JA4 in the WAF tab and save again
Nothing is blockedA rule with a higher priority number is overshadowed by another rule, or the IP is in Bypass IPsCheck the priority order and the bypass list
Turning on Enabled shows an errorrps=0 and there are no rulesSet 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 accountContact VNETWORK support; the rule is kept and starts working once JS Challenge is enabled
A JS Challenge rule, but the API/app only receives 429Working as designed — clients that cannot run JS always receive 429No 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) or 403 (timed_block), with Retry-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).