Issues when wildcard + custom hostnames pointing to worker

For Workers & Pages, what is the name of the domain?

Customer vanity URLs

What is the error number?

522

What is the issue or error you’re encountering

I have a worker that has both a wildcard subdomain associated to it and custom hostnames setup, which act as vanity URLs for my users. My wildcard subdomains are working, but custom hostnames added to the zone resolve to 522 (timeout) errors, which suggests my worker isn’t being triggered by them

What steps have you taken to resolve the issue?

  • Created a wildcard subdomain A record
  • Added a worker route for this wildcard (this works)
  • Added a proxy fallback CNAME record
  • Set my fallback domain in Custom Hostnames to this subdomain
  • Added custom hostnames
  • Added required DNS records in 3rd party on custom hostname, it shows as verified and active in the Cloudflare dashboard

Figured it out, I needed to update my worker route to be */* to capture the custom hostnames. Found that on this docs page, which was very well hidden (only found it thanks to another ticket in this forum).

I imagine the most common use-case for custom hostnames is workers/pages, so that page should probably be more discoverable.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.