What a 429 Error Means
429 Too Many Requests says the client went over a rate limit: too many requests from one address, account, or API key in a time window. The server is working and chose not to answer this request now. It may include a Retry-After header with the number of seconds to wait, or a date. Other codes are listed in HTTP status codes explained.
If You See It on Someone Else's Site
- Wait before trying again: limits usually reset within seconds or minutes.
- Stop rapid reloads and pause browser extensions that fetch pages in the background.
- Consider your network: on a shared office or mobile network, other people's requests may count against the same address.
Find Who Sent the 429
curl -I https://example.com/api/itemsCheck the Server header and any rate limit headers. If your application calls an outside API and logs a 429, the limit belongs to that API, and the fix is in your client code. If your own server sent it, look in the logs:
sudo grep '" 429 ' /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head
sudo grep 'limiting requests' /var/log/nginx/error.log | tailThe first command counts 429 responses per client address; the second shows Nginx's own messages about requests it held back. Application plugins and frameworks can also send 429 with no Nginx message.
Rate Limiting in Nginx
Define a zone in the http block and apply it in a location:
limit_req_zone $binary_remote_addr zone=perip:10m rate=10r/s;
server {
location /api/ {
limit_req zone=perip burst=20 nodelay;
limit_req_status 429;
}
}This allows each address 10 requests a second, with short bursts of up to 20 more. Without limit_, Nginx answers over-limit requests with 503, which looks like an outage; see 503 Service Unavailable. Test with sudo nginx -t and reload.
Behind a Proxy or CDN
Behind a CDN, every request arrives from the CDN's addresses, so a per-IP limit would count all visitors as a few clients. Tell Nginx to take the real address from the CDN's header, for each of the CDN's published ranges:
set_real_ip_from CDN_RANGE;
real_ip_header CF-Connecting-IP;Replace CDN_
Adjust the Limits
- Measure first: count how many requests a normal page view or app session makes before you pick a rate.
- Use burst: pages load many files at once; a burst absorbs that without raising the steady rate.
- Limit only what needs it: login forms, search, and APIs, not static files.
- Exempt trusted clients such as your monitoring with a
geoandmappair that sets an empty key for them; Nginx does not count requests with an empty key.
API Clients and Retry-After
A client that receives 429 should wait, not retry at once. Read Retry-After when it is present. When it is not, retry with exponential backoff: wait 1 second, then 2, then 4, with some random spread, up to a maximum. Cache answers you already have and batch small calls. Nginx's limit_ does not add a Retry-After header by itself; your application can.
Crawlers and Bots
Search engine crawlers slow down when they receive 429 or 503 responses. Some read a Crawl-delay line in robots.txt; Google ignores it. Block or limit crawlers you do not want by user agent, and keep limits loose enough that the crawlers you do want can still reach your pages.
Confirm the Limit Works
for i in $(seq 1 40); do curl -s -o /dev/null -w '%{http_code}\n' https://example.com/api/items; done | sort | uniq -cThe output counts each status code. Expect mostly 200 and some 429 once the burst is used up. If you see 503 instead of 429, the limit_ line is missing from that location. When heavy traffic produces server errors instead of 429, see 500 Internal Server Error.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations