Skip to content

Commit e81627f

Browse files
committed
Add release note and changelog entry
1 parent bac6f6c commit e81627f

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: "Custom Errors (beta): Stored Assets & Account-level Rules"
3+
description: Cloudflare introduces Custom Errors (beta), building on Custom Error Responses with new asset storage capabilities
4+
products:
5+
- rules
6+
date: 2025-02-11T11:00:00Z
7+
---
8+
9+
Cloudflare introduces [Custom Errors](/rules/custom-errors/) (beta), building on Custom Error Responses with new asset storage capabilities. This update allows users to store externally hosted error pages at Cloudflare edge and reference them in custom error rules, eliminating the need to supply inline content.
10+
11+
New capabilities:
12+
13+
- **Custom error assets** – Fetch and store external error pages at the edge for use in error responses.
14+
- **Account-Level custom errors** – Define error handling rules and assets at the account level for consistency across multiple zones. Zone-level rules take precedence over account-level ones, and assets are not shared between levels.
15+
16+
To store an external error page on the Cloudflare global network, submit a `POST` request to create an asset:
17+
18+
```bash
19+
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/custom_pages/assets" \
20+
--header "Authorization: Bearer <API_TOKEN>" \
21+
--header 'Content-Type: application/json' \
22+
--data '{
23+
"name": "maintenance",
24+
"description": "Maintenance template page",
25+
"url": "https://example.com/"
26+
}'
27+
```
28+
29+
Then, reference the stored asset in a custom error rule:
30+
31+
```bash
32+
curl --request PUT \
33+
"https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/phases/http_custom_errors/entrypoint" \
34+
--header "Authorization: Bearer <API_TOKEN>" \
35+
--header 'Content-Type: application/json' \
36+
--data '{
37+
"rules": [
38+
{
39+
"action": "serve_error",
40+
"action_parameters": {
41+
"asset_name": "maintenance",
42+
"content_type": "text/html",
43+
"status_code": 503
44+
},
45+
"enabled": true,
46+
"expression": "http.request.uri.path contains \"error\""
47+
}
48+
]
49+
}'
50+
```

src/content/changelogs/rules.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ productLink: "/rules/"
55
productArea: Application performance
66
productAreaLink: /fundamentals/reference/changelog/performance/
77
entries:
8+
- publish_date: "2025-02-11"
9+
title: "Custom Errors (beta): Stored assets and account-level rules"
10+
description: |-
11+
Cloudflare introduces [Custom Errors](/rules/custom-errors/) (beta), expanding on Custom Error Responses with new asset storage capabilities. With custom error assets, you can now retrieve and store externally hosted error pages at Cloudflare edge and reference them in custom error rules, eliminating the need to define error content inline. Additionally, Custom Errors now support account-level rules and assets, enabling consistent error handling across multiple zones.
812
- publish_date: "2025-01-29"
913
title: New Snippets code editor
1014
description: |-

0 commit comments

Comments
 (0)