All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

Rules - Custom Errors (beta): Stored Assets & Account-level Rules

1y ago

Source

CloudflareRules - Custom Errors (beta): Stored Assets & Account-level Rulescloudflare.com
Snippet from the RSS feed
We're introducing Custom Errors (beta), which builds on our existing Custom Error Responses feature with new asset storage capabilities. This update allows you to store externally hosted error pages on Cloudflare and reference them in custom error rules, eliminating the need to supply inline content. This brings the following new capabilities: Custom error assets – Fetch and store external error pages at the edge for use in error responses. 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. You can use Cloudflare API to upload your existing assets for use with Custom Errors: curl " \ --header "Authorization: Bearer " \ --header 'Content-Type: application/json' \ --data '{ "name": "maintenance", "description": "Maintenance template page", "url": " }' You can then reference the stored asset in a Custom Error rule: curl --request PUT \ " \ --header "Authorization: Bearer " \ --header 'Content-Type: application/json' \ --data '{ "rules": [ { "action": "serve_error", "action_parameters": { "asset_name": "maintenance", "content_type": "text/html", "status_code": 503 }, "enabled": true, "expression": "http.request.uri.path contains \"error\"" } ] }'

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.