For those looking to customize the error pages sans worker, had a report that this should work: http

For those looking to customize the error pages sans worker, had a report that this should work: https://developers.cloudflare.com/rules/custom-error-responses/

PUT https://api.cloudflare.com/client/v4/zones/:zoneId/rulesets/phases/http_custom_errors/entrypoint
{
    "rules": [
        {
            "action": "serve_error",
            "action_parameters": {
                "content": "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>404: object not found</title></head><body><img src=\"https://<my r2 bucket domain>/404.png\"/></html>",
                "content_type": "text/html"
            },
            "expression": "http.host eq \"<my r2 bucket domain>\" and http.response.code eq 404",
            "enabled": true
        }
    ]
}
Create rules that adjust incoming HTTP requests at the edge.
Was this page helpful?