Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: More flexible fallback handling — Custom Errors now support fetching assets returned with 4xx or 5xx status codes
description: Custom Errors can now fetch and store fallback assets even if the origin returns a 4xx or 5xx status code.
products:
- rules
date: 2025-06-09T18:00:00Z
---

[Custom Errors](/rules/custom-errors/) can now fetch and store [assets](/rules/custom-errors/create-rules/#create-a-custom-error-asset-dashboard) and [error pages](/rules/custom-errors/#error-pages) from your origin even if they are served with a 4xx or 5xx HTTP status code — previously, only 200 OK responses were allowed.

**What’s new:**
- You can now upload error pages and error assets that return error status codes (for example, 403, 500, 502, 503, 504) when fetched.
- These assets are stored and minified at the edge, so they can be reused across multiple Custom Error rules without triggering requests to the origin.

This is especially useful for retrieving error content or downtime banners from your backend when you can’t override the origin status code.

Learn more in the [Custom Errors](/rules/custom-errors/) documentation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Match Workers subrequests by upstream zone — cf.worker.upstream_zone now supported in Transform Rules
description: Transform Rules now support the cf.worker.upstream_zone field, letting you conditionally apply rules based on which zone sent Workers subrequest.
products:
- rules
date: 2025-06-09T17:00:00Z
---

import { Example } from "~/components";

You can now use the [`cf.worker.upstream_zone`](/ruleset-engine/rules-language/fields/reference/cf.worker.upstream_zone/) field in [Transform Rules](/rules/transform/) to control rule execution based on whether a request originates from [Workers](/workers/), including subrequests issued by Workers in other zones.

![Match Workers subrequests by upstream zone in Transform Rules](~/assets/images/changelog/rules/transform-rule-subrequest-matching.png)

**What's new:**
- `cf.worker.upstream_zone` is now supported in Transform Rules expressions.
- Skip or apply logic conditionally when handling [Workers subrequests](/workers/platform/limits/#subrequests).

For example, to add a header when the subrequest comes from another zone:

<Example>

Text in **Expression Editor** (replace `myappexample.com` with your domain):

```txt
(cf.worker.upstream_zone != "" and cf.worker.upstream_zone != "myappexample.com")
```

Selected operation under **Modify request header**: _Set static_

**Header name**: `X-External-Workers-Subrequest`

**Value**: `1`

</Example>

This gives you more granular control in how you handle incoming requests for your zone.

Learn more in the [Transform Rules](/rules/transform/) documentation and [Rules language fields](/ruleset-engine/rules-language/fields/reference/) reference.
10 changes: 4 additions & 6 deletions src/content/docs/rules/custom-errors/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ sidebar:

## Cannot preview error page

If Cloudflare cannot load your site or you have blocked the United States (US) via [IP Access rules](/waf/tools/ip-access-rules/) or WAF custom rules, publishing and previewing the error page will not work.
If Cloudflare cannot load your site or you have blocked the United States (US) via [IP Access rules](/waf/tools/ip-access-rules/) or WAF custom rules, publishing and previewing a custom error page might not work.

A common error might look like the following: `Error fetching page: Fetch failed, https://example.com/ipcountryblock.html returned 403 (Code: 1202)`.

Make sure that you are serving the custom error page with an `HTTP 200` status code, and that no WAF rule is blocking or challenging your custom error page.
Make sure that no WAF rule is blocking or challenging Custom Errors product when it is fetching the content of your custom error page.

## Error pages for blocked requests

If you block countries or IP addresses with an [IP Access rule](/waf/tools/ip-access-rules/), affected visitors will get a `1005` error and your **IP/Country Block** custom page.

If you block countries or IP addresses with a [WAF custom rule](/waf/custom-rules/) and you do not configure a [custom response](/waf/custom-rules/create-dashboard/#configure-a-custom-response-for-blocked-requests) for blocked requests in the rule, affected visitors will get your **WAF Block** page.
If you block countries or IP addresses with a [WAF custom rule](/waf/custom-rules/) and you do not configure a [custom error rule](/rules/custom-errors/create-rules/#create-a-custom-error-rule-dashboard) or a [WAF custom response](/waf/custom-rules/create-dashboard/#configure-a-custom-response-for-blocked-requests) for blocked requests, affected visitors will get your **WAF Block** page.

If you block requests due to a [rate limiting rule](/waf/rate-limiting-rules/) and you do not configure a [custom response for blocked requests](/waf/rate-limiting-rules/create-zone-dashboard/#configure-a-custom-response-for-blocked-requests) in the rule, affected visitors will get your **429 Errors** page displaying a Cloudflare `1015` error.
If you block requests due to a [rate limiting rule](/waf/rate-limiting-rules/) and you do not configure a [custom error rule](/rules/custom-errors/create-rules/#create-a-custom-error-rule-dashboard) or a [WAF custom response](/waf/rate-limiting-rules/create-zone-dashboard/#configure-a-custom-response-for-blocked-requests) for blocked requests, affected visitors will get your **429 Errors** page displaying a Cloudflare `1015` error.

If you block countries or IP addresses with a firewall rule (now deprecated), affected visitors will get your **1000 Class Errors** page.

Expand All @@ -41,8 +41,6 @@ Your custom error page cannot be blank and cannot exceed 1.5 MB in size (1,500,0

If you encounter errors while attempting to preview or publish your custom error page, use an [HTML validator](https://validator.w3.org/) to ensure that your code resolves properly.

Make sure that you are serving the custom error page with an `HTTP 200` status code.

## More resources

- [HTTP Status Codes](/support/troubleshooting/http-status-codes/)
Expand Down
Loading