Cloudflare Worker wildcard route silently blocks R2 custom domain, returns 404
A developer spent nearly a full day debugging persistent 404 errors on a Cloudflare R2 bucket served via a custom subdomain, despite all components appearing healthy in their respective dashboards. The root cause was a previously configured Cloudflare Worker with a wildcard route pattern covering all subdomains, which intercepted requests before they could reach R2. Because Cloudflare evaluates Worker routes independently of R2 custom domain settings, neither dashboard flagged the conflict. The fix was straightforward: replacing the wildcard route with explicit hostname patterns limited to the subdomains the Worker was actually meant to serve. The developer warns that this silent conflict can affect any new subdomain added to an account already running a Worker with a broad wildcard route.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in