Cloudflare R2 custom domain returns 404 — a Worker wildcard route was eating it

A Cloudflare Worker with a wildcard route was causing a custom domain for an R2 bucket to return 404 errors. The Worker was serving the site's 404 page instead of the R2 bucket. The solution was to enumerate the hostnames the Worker should serve, rather than using a wildcard route. This allowed the R2 bucket to be reached and the videos to work immediately. The issue was difficult to debug due to independent health reporting for each product.

Source →
FeedLens — Signal over noise Last 7 days