Cloudflare error 1015: You are being rate limited, and how to fix it

Error 1015 means a Cloudflare rate limiting rule blocked your requests. How owners find the rule, tune it for APIs and monitors, and what visitors can do.

· 6 min read · By the Spot Downtime team

Error 1015 "You are being rate limited" is a Cloudflare page, not one from your own application. It appears when a client sends more requests than a Cloudflare rate limiting rule allows in a given period. The request is stopped at Cloudflare's edge, so your origin server never sees it and your application logs show nothing.

The page is served with HTTP status 429. That makes it close to a normal 429 Too Many Requests, with one difference: the rule lives in Cloudflare's configuration, not in your code. It is also different from error 1020, where a firewall rule blocks a request outright. See Cloudflare error 1020 for that case.

Why it happens

A rate limiting rule counts requests that match an expression, usually grouped by client IP address, over a time window. When the count passes the threshold, Cloudflare applies the rule's action to further matching requests for a set duration. When the action is block, the visitor sees error 1015.

Typical reasons a legitimate client gets caught:

  • A script, scraper or integration that polls an endpoint in a tight loop.
  • A shared IP address, such as an office, school or VPN exit, where many people add up to one busy client.
  • A page that fires dozens of background requests (a dashboard, a single-page app) behind a rule written with a low threshold.
  • A rule meant to protect a login or search endpoint that was written too broadly and matches static assets too.
  • A client that retries immediately after a failure, which turns a small error into a burst that trips the limit.

If you own the site: find the rule

  1. Get the Ray ID shown at the bottom of the error page, and the visitor's IP address if you can.
  2. In the Cloudflare dashboard, open the domain and go to Security, then Events. Menu names vary a little between dashboard versions.
  3. Filter by Ray ID or IP address. The Service column should show rate limiting, and the rule name is listed beside it.
  4. Open the rule and read three things: the expression (which requests count), the threshold and period, and the action and duration.

If the event shows a different service, such as a managed rule or bot protection, you are looking at a different problem and the 1015 page is not the cause.

Fix the rule instead of removing it

Narrow what it matches

A limit meant for a login endpoint should match only the login path and only the method that matters. Matching the whole site counts every image, script and stylesheet toward the limit.

text
# Too broad: counts every request
(http.host eq "example.com")

# Narrower: counts only login attempts
(http.host eq "example.com" and http.request.uri.path eq "/login" and http.request.method eq "POST")

Raise the threshold or lengthen the window

Look at your real traffic before picking a number. A page load that triggers 40 API calls will exceed a limit of 30 requests per minute on its own. Set the threshold well above what a normal user produces, so the rule catches abuse and not ordinary use.

Change what identifies a client

Counting by IP address punishes everyone behind a shared address. If your API has authenticated users, counting by an API key or session header characteristic is fairer. Which options you have depends on your Cloudflare plan, so check what the rule editor offers.

Shorten the block duration

A short block lets a client that backed off recover quickly. A long block on a false positive can leave a customer locked out for much longer than the burst that caused it.

Exempt trusted clients

Add an exception for known partners, payment webhooks and your own monitoring. Allow them by a stable attribute such as an IP range or a secret header, not by loosening the rule for everyone. The firewall allowlist guide covers this.

If you write the client: back off properly

A client that hits a 429 should slow down, not retry at once. Read the Retry-After header if the response includes one, and otherwise use exponential backoff with some random jitter.

python
import random
import time
import requests

def get_with_backoff(url, max_tries=5):
    delay = 1.0
    for attempt in range(max_tries):
        resp = requests.get(url, timeout=10)
        if resp.status_code != 429:
            return resp
        wait = float(resp.headers.get("Retry-After", delay))
        time.sleep(wait + random.uniform(0, 0.5))
        delay = min(delay * 2, 60)
    return resp

Also cache responses you request repeatedly, and batch requests where the API allows it. The cheapest request is the one you don't send.

Monitoring and rate limits

A monitor is a client like any other. If it checks several URLs from several locations, a tight rule can block it and produce alerts for an outage that does not exist. Signs that this is happening: the check reports 429 while the site works in your browser, and the failures come and go.

Check the response body

A 429 from your own application and a 1015 from Cloudflare look the same in a status code column. The body tells them apart: the Cloudflare page names error 1015 and shows a Ray ID.

You can reproduce the behavior from the command line. Send a burst of requests and watch for the status change:

bash
for i in $(seq 1 60); do
  curl -s -o /dev/null -w "%{http_code} " https://example.com/api/ping
done; echo

If the output switches from 200 to 429 partway through, you have found the threshold. Run this against a test endpoint, not a production one, and keep the burst small.

Bulk HTTP status checkerCheck a list of URLs at once and see which ones return 429 or another unexpected status.

If you are a visitor

  • Wait a few minutes and reload once. Most blocks last for a limited time and clear by themselves.
  • Stop refreshing repeatedly, since each retry can extend the problem.
  • Turn off your VPN or try a different network. Shared IP addresses are a frequent cause.
  • If it keeps happening, send the site owner the Ray ID and the time. Only they can change the rule.

Catching it early

Rate limit rules fail quietly: nothing is down, yet some users or integrations are refused. A website monitor or API monitor with an expected status of 200 on your key endpoints will flag a block as soon as one hits the monitoring traffic, and checks from several regions help show whether the limit is tied to one location. After changing a rule, run the affected URLs again to confirm they pass.

Get new guides by email

Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.

Unsubscribe from any email with one click. See our privacy policy.

Keep reading