# 429 Too Many Requests in nginx

> Fix or configure an nginx 429 Too Many Requests: nginx rate limits return 503 by default, so learn limit_req_status, burst, nodelay and Retry-After.

Canonical: https://scaplet.com/errors/http/429/nginx

Guide Error · HTTP status codes

Fix or configure an nginx 429 Too Many Requests: nginx rate limits return 503 by default, so learn limit_req_status, burst, nodelay and Retry-After.

3 min

read

7

sources

Oct 22, 2026

updated

Scaplet Editorial Team

author

429 4xx · Client error

The short answer

nginx returns 429 Too Many Requests only when you set it: its rate limiting modules answer 503 by default, so a 429 comes from `limit_req_status 429`, `limit_conn_status 429` or from the app behind nginx. A client crossed a configured rate or connection limit. Check `limit_req_zone`, `burst` and the key, and send a `Retry-After` header.

1. [When nginx sends a 429](#when-nginx-sends-a-429)
2. [Configure rate limiting that returns 429](#configure-rate-limiting-that-returns-429)
3. [Exempt a client, test the limit and verify](#exempt-a-client-test-the-limit-and-verify)

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F429%2Fnginx%20(%22429%20Too%20Many%20Requests%20in%20nginx%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F429%2Fnginx%20(%22429%20Too%20Many%20Requests%20in%20nginx%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F429%2Fnginx%20(%22429%20Too%20Many%20Requests%20in%20nginx%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F429%2Fnginx%20(%22429%20Too%20Many%20Requests%20in%20nginx%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

_01_Defaults that decide the status code

## When nginx sends a 429

RFC 6585 defines 429 as "the user has sent too many requests in a given amount of time (\"[rate limiting](/glossary/rate-limiting)\")". The general meaning and what a visitor can do are on [429 Too Many Requests](/errors/http/429). In nginx there is one surprise worth knowing first: the modules that do the limiting reject requests with 503 unless you say otherwise.

Directive

### `limit_req_status`

Default

`503`

What it sets

The status for requests rejected by `limit_req`

Directive

### `limit_conn_status`

Default

`503`

What it sets

The status for requests rejected by `limit_conn`

Directive

### `limit_req_log_level`

Default

`error`

What it sets

The log level for refused requests; delays are logged one level lower

So if your site shows 503 under load and you expected 429, change the status. If it shows 429 and you never set it, the 429 comes from the app behind nginx, from a CDN, or from another rule. nginx's `$upstream_status` variable holds the upstream's [status code](/glossary/http-status-codes), so logging it separates the two.

_02_The settings that change who gets a 429

## Configure rate limiting that returns 429

Setting

### `rate=1r/s`

What it does

Average rate per key. Use `r/m` for less than one request per second; 30r/m is half a request per second

Setting

### `burst=5`

What it does

Excess requests allowed beyond the rate. The default burst is zero, so any request over the rate is rejected

Setting

### `nodelay`

What it does

Excess requests within the burst are served at once instead of being spaced out

Setting

### `delay=number`

What it does

Excess requests above this number are delayed; the default is zero, so all excess requests are delayed

Setting

### Key

What it does

`$binary_remote_addr` counts per client IP. Requests with an empty key are not accounted

Setting

### Zone size

What it does

One megabyte keeps about 16 thousand 64-byte states or about 8 thousand 128-byte states, so `10m` holds roughly 80 to 160 thousand. When the zone is full, nginx removes the least recently used state

Limit one IP to 1 request per second with a burst of 5

```
http { limit_req_zone $binary_remote_addr zone=perip:10m rate=1r/s; limit_req_status 429; server { location /search/ { limit_req zone=perip burst=5 nodelay; add_header Retry-After 1 always; } } }
```

`add_header` only adds a field for listed success and redirect codes unless you add `always`, so `Retry-After` needs `always` to appear on the 429. RFC 6585 says a 429 response "MAY include a Retry-After header indicating how long to wait before making a new request".

**Do not rate limit crawlers by accident**Google says its crawlers treat a 429 as a signal that the server is overloaded and slow down. A tight limit on a shared key can therefore throttle crawling. Test with `limit_req_dry_run on;` first: the zone counts excessive requests as usual, but nothing is rejected. The general behavior is on [429 Too Many Requests](/errors/http/429).

_03_Check it

## Exempt a client, test the limit and verify

Because requests with an empty key are not accounted, you can map trusted addresses to an empty key and everyone else to the client address.

Trigger the limit from the command line

```
for i in $(seq 1 12); do curl -s -o /dev/null -w "%{http_code}\n" https://example.com/search/ done
```

With the first config, if the loop finishes within about a second, the first six requests should pass (one at the rate plus a burst of five) and later ones return 429 with `Retry-After`. Rejected requests are logged at `error` level, so they appear in the default error log. For a related overload code, see [503 Service Unavailable](/errors/http/503); Google's status code documentation groups 429 with the [5xx errors](/errors/http/5xx-errors) for crawl-rate purposes, and [5xx server errors](/seo-issues/server-errors-5xx) covers the crawl impact.

Skip rate limiting for trusted IPs

```
map $remote_addr $limit_key { 203.0.113.10 ""; # trusted: empty key is not counted default $binary_remote_addr; } limit_req_zone $limit_key zone=perip:10m rate=5r/s;
```

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ How do I fix 429 Too Many Requests in nginx?

Find the `limit_req` or `limit_conn` rule that fired, then raise the `rate`, add or raise `burst`, or exempt trusted clients with an empty key. If the 429 comes from the app behind nginx, fix the limit there; `$upstream_status` shows which.

_02_ Why does nginx rate limiting return 503 and not 429?

The default for both `limit_req_status` and `limit_conn_status` is 503. Set the directive to 429 to return that status.

_03_ How long should a client wait after a 429?

The `Retry-After` header, if the server sends one, says how long. RFC 6585 says a 429 response may include it, and in nginx you add it with `add_header ... always`.

_04_ Is error 429 my fault?

As a visitor you sent more requests than the site allows in a given time, so slow down or wait. As the site owner, the limit is your configuration.

Sources · 7

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- rfc-editor.org
- nginx.org
- google.com

1. 01 [RFC 6585: Additional HTTP Status Codes](https://www.rfc-editor.org/rfc/rfc6585.html) rfc-editor.org · checked 2026-10-25
2. 02 [nginx: ngx_http_limit_req_module](https://nginx.org/en/docs/http/ngx_http_limit_req_module.html) nginx.org · checked 2026-10-25
3. 03 [nginx: ngx_http_limit_conn_module](https://nginx.org/en/docs/http/ngx_http_limit_conn_module.html) nginx.org · checked 2026-10-25
4. 04 [nginx: ngx_http_headers_module](https://nginx.org/en/docs/http/ngx_http_headers_module.html) nginx.org · checked 2026-10-25
5. 05 [nginx: ngx_http_map_module](https://nginx.org/en/docs/http/ngx_http_map_module.html) nginx.org · checked 2026-10-25
6. 06 [nginx: ngx_http_upstream_module](https://nginx.org/en/docs/http/ngx_http_upstream_module.html) nginx.org · checked 2026-10-25
7. 07 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-10-25

## Keep learning

[All errors](/errors)

[Learn 429 Too Many Requests HTTP status codes](/errors/http/429) [Related 5xx server errors Status codes and links](/seo-issues/server-errors-5xx) [Read next 503 Service Unavailable HTTP status codes](/errors/http/503) [Do Run a free site audit Free, about two minutes](/site-audit)

Other 429 errors
[429 Too Many Requests](/errors/http/429) [429 Too Many Requests on Cloudflare](/errors/http/429/cloudflare) [Vercel 429: Too Many Requests](/errors/cdn/vercel-429)

Nearby in errors
[HTTP 431 Request Header Fields Too Large](/errors/http/431) [451 Unavailable For Legal Reasons](/errors/http/451)

More in 429 Too Many Requests
[429 Too Many Requests in nginx](/errors/http/429/nginx) [429 Too Many Requests on Cloudflare](/errors/http/429/cloudflare)

Terms on this page
[Rate limiting](/glossary/rate-limiting) [HTTP status codes](/glossary/http-status-codes)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
