HTTP 429 · 4XX RFC 6585 §4 Cacheable: No Retryable: Yes (honor Retry-After + jitter)

HTTP 429 Too Many Requests: Root Causes & Production Fix Guide

HTTP 429 Too Many Requests signals that the client exceeded an API or WAF rate limit. Proper 429 handling combines server-side `Retry-After` / `RateLimit-*` headers with client-side exponential backoff and jitter.

Top Root Causes of HTTP 429

Nginx Rate Limit Returning 429 + Retry-After

limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s;
server {
    location /api/ {
        limit_req zone=api_limit burst=20 nodelay;
        limit_req_status 429;
        add_header Retry-After 10 always;
        proxy_pass http://127.0.0.1:3000;
    }
}

Verify with cURL

curl -i -sS https://api.example.com/v1/search

Interactive Stack Diagnoser (HTTP 429)

Frequently Asked Questions

Why does Nginx return 503 instead of 429 by default on rate limits?

Nginx historically defaulted `limit_req_status` to 503. Always set `limit_req_status 429;` so clients and monitors distinguish rate limiting from server outages.

How should clients retry a 429 response?

Read the `Retry-After` header (seconds or HTTP-date) first; if absent, apply capped exponential backoff with random full jitter.

Why are all my users getting 429 behind Cloudflare?

Nginx is rate-limiting Cloudflare's edge IP instead of the visitor IP. Configure `set_real_ip_from` with Cloudflare IP ranges and `real_ip_header CF-Connecting-IP;`.

Related Status Guides & Header Tools