Skip to content

Cloudflare 429 too many requests and challenge loops: causes and fixes

A Cloudflare 429 too many requests comes from either a rate limiting rule or your own origin — and challenge loops have their own separate causes. Here is how to tell the sources apart and fix each one.

A 429 “Too many requests” on a Cloudflare-proxied site has exactly two possible authors: a Cloudflare rate limiting rule configured in the zone (the block page says “error 1015: you are being rate limited”), or your own origin generating 429s that Cloudflare passes through untouched. The related complaint — visitors stuck solving challenge after challenge in a loop — is a third, separate mechanism with its own causes. The first diagnostic step for all of them is the same: look at who signed the response.

What’s happening

Rate limiting runs at the edge: a rule counts requests that match an expression (per IP, by default) over a window, and when the counter crosses the threshold, the configured action fires for a timeout period — typically Block, which returns HTTP 429 with Cloudflare’s 1015 error page. Rate limiting rules are available on all plans, with the counting characteristics and advanced options growing on higher plans; the configuration lives under Security → WAF → Rate limiting rules and is documented in Cloudflare’s WAF docs. If the origin sends its own 429 (a WordPress security plugin, LiteSpeed per-IP throttling, an API framework’s limiter), Cloudflare forwards it as-is — dashboard settings did not cause it and cannot remove it.

Challenge loops are different machinery. When a rule issues a Managed Challenge, the visitor who passes receives a cf_clearance cookie, valid for the zone’s Challenge Passage duration (Security → Settings). The loop happens when that proof does not stick: the browser refuses or discards the cookie (privacy extensions, aggressive tracking protection), the visitor’s IP changes between solving and the next request (rotating VPNs, some carrier NAT), or the challenge is being served to a request that cannot solve it at all — an AJAX call, an API client, an image URL — which then fails silently and retriggers forever.

What to check first

  • Read the 429 body. Cloudflare’s page names error 1015; your app’s JSON or a plugin’s HTML means origin-generated.
  • Check Security → Events for Rate limiting events at the matching timestamps — if the log has nothing, Cloudflare did not do it.
  • Who is hitting the limit? One aggressive crawler, your own frontend polling too hard, or every user during a sale — same status code, three different problems.
  • For loops: does a clean browser profile pass? No extensions, default privacy settings. If yes, the visitor’s browser hygiene is the variable.
  • Are challenges firing on non-page requests? Loops that only affect logged-in app views usually mean challenged XHR calls.

How to verify

# Who authored the 429 - Cloudflare's page or the origin's?
curl -s -o /dev/null -D - https://example.com/api/endpoint | grep -iE 'HTTP/|cf-ray|retry-after|cf-mitigated'
curl -s https://example.com/api/endpoint | grep -io 'error code: 1015'

# Same request straight to the origin: a 429 here proves it is origin-made
curl -s -o /dev/null -w '%{http_code}\n' --resolve example.com:443:203.0.113.10 https://example.com/api/endpoint

# Trip test from a lab machine: watch when the threshold cuts in
for i in $(seq 1 30); do curl -s -o /dev/null -w '%{http_code} ' https://example.com/api/endpoint; done; echo

# Challenge diagnostics: is the response a challenge, and does clearance persist?
curl -s -o /dev/null -D - https://example.com/ | grep -iE 'cf-mitigated|set-cookie: cf_clearance'

On the origin side, grep the stack that likes to throttle: grep -ri "429" /var/log/nginx/error.log, a WordPress security plugin’s own log, or your framework’s rate-limit middleware config.

The fix

  1. Tune the rate limiting rule that is over-firing — raise the threshold, lengthen the window, or narrow the expression to the endpoints that need protection (login, search, API writes) instead of the whole site. Real-world sizing is covered in rate limiting rules: thresholds and characteristics. Remember the counter is per IP by default: an office or campus NAT aggregates hundreds of humans into one “abuser”.
  2. Exempt legitimate automation — webhooks, monitors, and partner APIs need a skip: either exclude their documented IP ranges in the rule expression, or add a WAF custom rule with Skip scoped to path plus source — the action mechanics are in WAF custom rules: block, challenge, log, skip.
  3. Fix the origin’s own limiter — if the 429 is origin-made, tune it where it lives: the security plugin’s throttle settings, LiteSpeed’s per-IP connection limits, or the API middleware. And if the origin sees every request as coming from a handful of Cloudflare IPs, its per-IP limiter punishes everyone for everyone — restore real visitor IPs first.
  4. Stop challenging requests that cannot pass — scope challenge actions to HTML document requests: exclude /api/*, asset paths, and XHR-heavy routes in the rule expression. A challenged AJAX call fails invisibly and looks exactly like a loop or a broken app.
  5. Lengthen Challenge Passage and prefer Managed Challenge — in Security → Settings, a longer passage means one solve lasts hours instead of minutes; Managed Challenge picks the least intrusive verification and passes far more humans without interaction than the interactive variant.
  6. Your own frontend is the flood — a polling loop, a retry-without-backoff, or a misconfigured service worker can trip your limits by itself. Honour Retry-After and add exponential backoff before touching thresholds.

When this fix is wrong

If the 429s persist when you test directly against the origin, no amount of Cloudflare tuning will help — the limiter is in your own stack. In the reverse direction: if a user “keeps getting blocked” but Security Events shows nothing, look for an origin limiter or an entirely different error being paraphrased. And a challenge loop that only one visitor in a thousand experiences is nearly always that visitor’s extensions or network, not your configuration.

Common mistakes

  • Deleting the rate limiting rule outright because one customer complained — the login brute-force it was stopping resumes the same night.
  • Rate-limiting per IP on sites with heavy corporate or mobile-carrier NAT traffic, then reading the complaints as bot attacks.
  • Challenging every request site-wide “for security”, including APIs and webhooks that can never solve a challenge.
  • Forgetting that the browser cache or a CDN in front can mask a fix — verify with curl, not with a reload.

Prevention

  • Load-test thresholds against real peak traffic patterns before enforcing Block; run rules in Log action first and read Security Events.
  • Keep an inventory of automation that touches the site (webhooks, monitors, integrations) and bake their exemptions into the rules from day one.
  • Alert on rate limiting event volume — a spike is either an attack or a misconfiguration, and both deserve a look within hours.
  • Set client-side retry policies (backoff plus Retry-After) on your own apps so they degrade politely at the limit.
  • Re-test the challenge experience quarterly from a clean browser and a mobile connection, not just from the office.

Once you know who signed the 429 — the edge, the origin, or a challenge that could never be passed — the fix is usually one setting away. If the error keeps coming back, the problem usually sits between Cloudflare and the origin — Stack Harbor operates that whole path under Managed Cloud Ops, and you can book an infrastructure review.