Rate Limiting (previous version)·续

The new rule appears in the rate limiting rules list.

Note

Any change to a rate limiting rule clears that rule's currently triggered actions. Take care when editing rate limiting rules to mitigate an ongoing attack.

In general, when setting a lower threshold:

  1. Leave existing rules in place and add a new rule with the lower threshold.
  2. Once the new rule is in place, wait for the action duration of the old rule to pass before deleting the old rule.

When setting a higher threshold (due to legitimate client blocking), increase the threshold within the existing rule.


Task 2: Configure Advanced Criteria (only Business and Enterprise plans)

The Advanced Criteria option configures which HTTP methods, header responses, and origin response codes to match for your rate limiting rule.

To configure your advanced criteria for a new or existing rule:

  1. Expand Advanced Criteria.Available fields when configuring Advanced Criteria for a rate limiting rule.
  2. Select a value from Method(s). The default value is ANY, which matches all HTTP methods.
  3. Filter by HTTP Response Header(s). Select Add header response field to include headers returned by your origin web server.

The CF-Cache-Status header appears by default so that Cloudflare serves cached resources rather than rate limit those resources. To also rate limit cached resources, remove this header by selecting X or enable Also apply rate limit to cached assets.

If you have more than one header under HTTP Response Header(s), an AND boolean logic applies. To exclude a header, use the Not Equals option. Each header is case insensitive. 4. Under Origin Response code(s), enter the numerical value of each HTTP response code to match. Separate two or more HTTP codes with a comma (for example: 401, 403). 5. (Optional) Configure additional rate limiting features, based on your plan. 6. Select Save and Deploy.


Task 3: Configure Advanced Response (only Business and Enterprise plans)

The Advanced Response option configures the information format returned by Cloudflare when a rule's threshold is exceeded. Use Advanced Response when you wish to return static plain text or JSON content.

To configure a plain text or JSON response:

  1. Expand Advanced Response.Available fields when configuring an Advance Response for a rate limiting rule.
  2. Select a Response type format other than the default: Custom JSON or Custom TEXT.
  3. Enter the plain text or JSON response you wish to return. The maximum response size is 32 KB.
  4. (Optional) Configure additional rate limiting features, based on your plan.
  5. Select Save and Deploy.

Using a custom HTML page or a redirect

If you wish to display a custom HTML page, configure a custom page for HTTP 429 errors (Too many requests) in the dashboard. Cloudflare will display this page when you select Default Cloudflare Rate Limiting Page in Response type (the default value for the field).

You can use the following method to redirect a rate-limited client to a specific URL:

  1. Create an HTML page on your server that will redirect to the final URL of the page you wish to display. Include a meta refresh ↗︎ tag in the page content, like in the following example:
   <!doctype html>
   <html>
    <head>
        <meta charset="utf-8" />
        <title>Custom RL page</title>
        <meta
            http-equiv="refresh"
            content="0; url='https://yourzonename/block'"
        />
    </head>

<body></body>
   </html>
   ```

Take note of the public URL of the page you created.
2. In the Cloudflare dashboard, go to the **Settings** page. [Go to **Configurations** ↗](https://dash.cloudflare.com/?to=/:account/configurations)
3. Go to **Error Pages**.
4. Next to **Rate limiting block**, select the three dots > **Edit**.
5. Select **Custom page**.
6. In **Custom page address**, enter the URL of the page you created on your server — the page containing the meta `refresh` tag.
7. Select **Save**.

Follow the same approach if you wish to return plain text or JSON content but the response is larger than 32 KB. In this case, the redirect URL would be the URL of the plain text or JSON resource you would like to display.

Notes

- Your rate limiting rule must not match the redirect URL you included in the custom HTML page for `429` errors.
- To protect from denial-of-service (DoS) attacks, the page for the redirect should only include resources cached by Cloudflare.

---

## Task 4: Configure the Bypass option (Enterprise plans only)

**Bypass** creates an allowlist or exception so that no actions apply to a specific set of URLs even if the rate limit is matched.

To configure **Bypass**:

1. Expand **Bypass**.
2. In **Bypass rule for these URLs**, enter the URL(s) to exempt from the rate limiting rule. Enter each URL on its own line. An HTTP or HTTPS specified in the URL is automatically removed when the rule is saved and instead applies to both HTTP and HTTPS.![Configuring two URLs to bypass for a rate limiting rule (one per line).](/uploads/projects/cf-dev-v3/202611/18e71f360fc11a9f.png)
3. (Optional) Configure additional rate limiting features, based on your plan.
4. Select **Save and Deploy**.

---

## Analytics

View rate limiting analytics for your zone in **Analytics & logs** > **Security**. Rate Limiting analytics uses solid lines to represent traffic that matches simulated requests and dotted lines to portray actual blocked requests. Logs generated by a rate limiting rule are only visible to Enterprise customers via [Cloudflare Logs](https://developers.cloudflare.com/logs/).

Cloudflare returns an `HTTP 429` error for blocked requests. Details on blocked requests per location are provided to Enterprise customers under **Status codes** in the analytics dashboard available at **Analytics** > **Traffic**.

Note

`HTTP 429` responses sent to website visitors will include any `HTTP 429` responses returned from the origin if the origin server also applies its own rate limiting.

---

## Order of rule execution

Rate limiting rules are evaluated from the most recently created rule to the oldest rule.

For example, if a request matches the following two rules:

- Rule #1: Matching with `test.example.com` (created on 2024-03-01)
- Rule #2: Matching with `*.example.com*` (created on 2024-03-12)

Then rule #2 will trigger first because it was created last.

Additionally, when there is a match and the WAF applies a *Log* action, it continues evaluating other rate limiting rules, since *Log* is a non-terminating action. If the WAF applies any other action, no other rules will be evaluated.

---

## Limitations

Rate Limiting is designed to limit surges in traffic that exceed a user-defined rate. The system is not designed to allow a precise number of requests to reach the origin server. There might be cases where a delay is introduced between detecting the request and updating the internal counter. Because of this delay, which can be up to a few seconds, excess requests could still reach the origin before an action such as blocking or challenging is enforced.

---

## Related resources

- [Troubleshooting Rate Limiting (previous version)](https://developers.cloudflare.com/waf/reference/legacy/old-rate-limiting/troubleshooting/)
- [Configure Rate Limiting via the Cloudflare API](https://developers.cloudflare.com/api/resources/rate_limits/methods/create/)

Was this helpful?

YesNo

## On this page

[![](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2NiIgaGVpZ2h0PSIzMCIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDY2IDMwIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNzQ2XzIpIj48cGF0aCBmaWxsPSIjZmY5OTEwIiBkPSJNNTMuMTIgMTMuMTI1YzYuOTk3IDAgMTIuNjY4IDUuNzA4IDEyLjY2OCAxMi43NSAwIDEuMjU1LS4xOCAyLjQ2OC0uNTE2IDMuNjE0YS43Mi43MiAwIDAgMS0uNjk0LjUxMUg0Ni45NTNhLjM3NS4zNzUgMCAwIDEtLjM0OC0uNTFsLjMzNy0uODgyYzEuMDc2LTIuODMzIDQuMTQ2LTUuMTU0IDYuOTg3LTUuMjlsNS4zODQtLjI3N2EuNTQzLjU0MyAwIDAgMCAuNTE0LS41NDQ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ers.cloudflare.com/waf/rate-limiting-rules/#page","headline":"Rate Limiting (previous version)","description":"Documentation for the previous version of Rate Limiting.","url":"https://developers.cloudflare.com/waf/rate-limiting-rules/","inLanguage":"en","image":"https://developers.cloudflare.com/waf/reference/legacy/old-rate-limiting/og.png?v=c448e9ace0a59a85","dateModified":"2026-06-05","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Troubleshoot issues with the previous version of Rate Limiting. title: Troubleshoot Rate Limiting (previous version) image: https://developers.cloudflare.com/waf/reference/legacy/old-rate-limiting/troubleshooting/og.png?v=5e67242954c68c6a


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/waf/llms.txt
Use this file to discover all available pages before exploring further.