Free auditStart free
GuideError · HTTP status codes

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.

3 min
read
7
sources
Oct 22, 2026
updated
Scaplet Editorial Team
author
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
  2. Configure rate limiting that returns 429
  3. 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 withChatGPTClaudePerplexityGoogleAI Mode
01Defaults 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\")". The general meaning and what a visitor can do are on 429 Too Many Requests. 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, so logging it separates the two.

03Check 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; Google's status code documentation groups 429 with the 5xx errors for crawl-rate purposes, and 5xx server errors 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.

01How 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.

02Why 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.

03How 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.

04Is 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. 01RFC 6585: Additional HTTP Status Codesrfc-editor.org · checked 2026-10-25
  2. 02nginx: ngx_http_limit_req_modulenginx.org · checked 2026-10-25
  3. 03nginx: ngx_http_limit_conn_modulenginx.org · checked 2026-10-25
  4. 04nginx: ngx_http_headers_modulenginx.org · checked 2026-10-25
  5. 05nginx: ngx_http_map_modulenginx.org · checked 2026-10-25
  6. 06nginx: ngx_http_upstream_modulenginx.org · checked 2026-10-25
  7. 07How HTTP status codes affect Google's crawlersdevelopers.google.com · checked 2026-10-25
Free · 2 minutes

Tools point. Agencies advise. This one ships.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane