nginx limit_req
The nginx project (open source) · api security · reviewed by Stan K. · Source: data snapshot · data as of 2026-11-13
The $0 rate limiter you own outright: a per-key leaky bucket in ten lines of config — no meter, no plan and no vendor; the whole cost is the box it runs on.
#2 of 8 in Api Security
ToolScore breakdown — why 75/100
10 criteria × 10 points. Low pillars are visible on purpose — that's the point of a score you can audit. Methodology →
What it does well
- ▸Zero per-request cost at any volume — 50M or 500M, the price is the server
- ▸No meter, no plan and no vendor — ten lines of config buys a per-IP rate limit the vendor cannot reprice, cap or retire
- ▸Documented module behavior: "limit the request processing rate per a defined key… excessive requests are terminated" — the mechanism is specified, not marketed
- ▸Your data never leaves the box — there is no forwarding server, no cloud console and no account to compromise
- ▸The last line of defense behind whatever edge you pick — it still wins for internal APIs and zero-cloud setups
Where it costs you
- ▸Counts one key (the IP) on one box — a single-box view of a distributed world
- ▸NAT collateral: one office IP means the whole office shares a single 10 r/s bucket and humans start eating 429s
- ▸Distributed low-and-slow from 50K IPs defeats it politely — every address stays under 10 r/s, so no single bucket trips
- ▸Nothing above L7 counting: no WAF rules, no managed rulesets, no bot defense; even nftables one layer down gives nothing above L4
- ▸The volumetric flood kills the pipe before a request reaches nginx — a flood absorbed at the edge is a flood your server never sees, and nginx is not the edge
Hidden traps — the stuff the pricing page doesn't say
limit_req counts one key — the IP — on one box. Behind an office NAT that means the whole office shares a single 10 r/s bucket: one heavy user's scripts and every human in the building start eating 429s together. The key is the unit of punishment, not the abuser.
Distributed low-and-slow attack traffic keeps every address politely under 10 r/s — no single bucket trips, and the aggregate still buries the app. This is our analysis, consistent with the module's per-key design, not an nginx-documented limit.
Volumetric L3/L4 floods kill the network link before a request ever reaches nginx — a per-IP leaky bucket cannot absorb what the NIC never receives. A flood absorbed at the edge is a flood your server never sees, and nginx is not the edge (our analysis, consistent with the module's per-key design).
Know the limits before you pay: read the traps above, then decide with eyes open.
Visit official siteAffiliate link where available — never affects the score.
- official nginx limit_req module docs — per-key leaky bucket behavior (official, checked 2026-11-13) verified
Data as of 2026-11-13. Prices and limits change monthly — report anything stale. How we verify: methodology.
Closest alternatives
The $0 edge stack — unmetered WAF, rate limiting and L3/L4/L7 DDoS on every plan including Free; the
Pure pay-as-you-go with every cent published — $5/web ACL, $1/rule, $0.60/1M requests — and a meter
The DIY rate limiter's meter: $0.20 per 100K Redis commands PAYG, a real free tier (500K commands/mo
nginx limit_req review
In-depth analysis · last updated 2026-11-13
Ten lines and no vendor
The documented behavior: nginx limits "the request processing rate per a defined key… excessive requests are terminated" — a leaky bucket keyed per IP. The reference config is ten lines: limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s, limit_req zone=api burst=20 nodelay, limit_req_status 429. That buys a per-IP rate limit with no meter, no plan and no vendor — the whole cost is the box it runs on. Zero per-request cost at any volume: 50M or 500M requests, the price is the server.
What it cannot stop
The limits are structural, and honesty requires labeling them our analysis — consistent with the module's per-key design, not nginx-documented limits. Volumetric L3/L4 floods: the pipe dies before a request reaches nginx. Distributed low-and-slow from 50K IPs: every address stays politely under 10 r/s, so no single bucket trips while the aggregate buries the app. NAT collateral: one office IP means the whole office shares a single 10 r/s bucket and humans start eating 429s. One layer down, nftables adds connection and packet-rate limits at the firewall itself — same $0, same single-box view, nothing above L4.
Why it still earns its score
For internal APIs, zero-cloud setups, and the last line of defense behind whatever edge you pick, limit_req is the honest maximum: the mechanism is specified in module docs rather than marketed, it cannot be repriced or retired by a vendor, and its failure modes are the failure modes of your own box rather than of someone else's roadmap. The data-handling posture is unique in this hub's rate-limiting table — there is no forwarding server, no cloud console and no account: your traffic never leaves the machine that counts it.
How the pillars land
Price/Value 10: $0 at any volume — the only 10 in this hub's rate-limiting table alongside nothing else. Request & rate limits 6: real per-key limiting with a documented mechanism, but a single-box, single-key view of a distributed world — NAT collateral, low-and-slow and volumetric floods all pass it by. Latency & edge 5: nothing verifiable in this snapshot — your box is the edge, and no number was measured. Data handling 9: no meter, no plan and no vendor — the traffic stays on the box. Self-host/own WAF 10: self-hosted by definition; the software is the entire product. Feature set 5: one mechanism — a leaky bucket; no rules, no managed sets, no bot defense, and nothing above L4 even with nftables. Track record 8: documented module behavior in a server that has carried the web for decades. Ease of use 7: ten lines of config — but they are yours to tune, monitor and misconfigure. Pricing transparency 9: the price is $0 and the docs say what the module does. Support & docs 6: the official module docs are the support surface — precise but minimal.
Verdict — OWN THE SERVER, 75/100
Cloudflare Free beats nginx for a public API — a flood absorbed at the edge is a flood your server never sees, and the same $0 buys unmetered L3/L4/L7 absorption, the Free Managed Ruleset, 5 custom rules and Turnstile. nginx limit_req still wins for internal APIs, zero-cloud setups, and as the last line of defense behind whatever edge you pick. At 75/100 it ties Cloudflare Free on our scale by winning entirely different pillars: ownership and data handling instead of feature breadth — pick by threat model, not by the tie.