Skip to content
gohacks.dev
DevOps

Nginx Rate Limiting Generator

Generate Nginx limit_req and limit_conn configuration for a login form or an API, with burst, nodelay, a 429 status and IPs that are never limited.

Free · No sign-up · Your inputs stay in your browser

Input

Generate Nginx rate limiting

Output

Rate limit

382 characters

One request is let through every 12.0 s per client. burst=10 queues up to 10 extra requests; with nodelay they are served immediately and the slots refill at the rate, without it they are spaced out at the rate. Anything beyond gets 429. An empty key is not counted, which is how the exempt list works. Behind a proxy or CDN, set real_ip_header first or every visitor shares the proxy's address.

Runs in this browser. Nothing you paste is sent to a server.

What burst and nodelay do

Nginx's limiter is a leaky bucket: requests are allowed at the rate, and burst lets up to that many extra requests queue. Without nodelay, queued requests are released at the rate, adding latency; with nodelay they are served at once and the burst slots refill at the rate, which suits browsers loading a page's assets. The limit_req module reference describes both.

Behind a proxy or CDN

Behind a load balancer every request arrives from the proxy's address, so all visitors share one bucket. Set real_ip_header and set_real_ip_from for your proxies first, so $binary_remote_addr is the real client.

Share

Frequently asked questions

What status code does Nginx return when rate limiting?
503 by default. limit_req_status 429; returns Too Many Requests, which clients and monitoring understand as rate limiting.
How much memory does a limit_req zone need?
A 1 MB zone holds about 16,000 IPv4 states with $binary_remote_addr. 10m is plenty for most sites.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools