Setting up CF Pages site with GCP nameserver

Hello CF peoples,

Before I crack on I’ll hold my hands up to this stuff not being my forte, so please excuse me if I’m just confused (I’m no doubt confused!)
I’m in the process of moving over my site’s PR builds to be hosted using CF Pages, and I could use a little help. My current setup is in GCP. If all goes well I will move staging and prod over to CF at a later date, but for now I’m just trying to use CF for hosting the PR builds.
I’ve got the github action working, I see deploys coming through in my CF dashboard and my site was indeed deployed - all good so far.

Where I’ve got stuck is in trying to figure out how to repoint wildcarded subdomains of my existing domain over to CF.
So in GCP I have two CNAME records of note:

  • one for staging that is → [the place it needs to go]
  • one for PR builds that is * → [static domain of old PR hosting service]

What I’m trying to figure out is how to point my wildcarded subdomain record over the CF. My confusion comes from the fact that the CF domains generated for CF Pages are like [6-char-hex]-[git-repo-name], and as far as I’m aware you can’t CNAME wildcard to wildcard… so… how do I point * over to CF in a way that it’ll persist the subdomain over to CF? Or does CF have a static domain I should point to that’ll figure out the subdomain from the origin address?

The documentation around custom domains drives you to have CF take ownership of everything, which I don’t want to do at this point, as I’ll lose that resolution for the staging site. Even the subsection on setting up a CNAME record that says “If you do not want to point your nameservers to Cloudflare…” finishes up with a note explaining you need to go through the custom domain setup or else you’ll get 522s, but that custom domain setup talks of migrating DNS records, so I backed off from there.

Given that this stuff is not my forte, I’m keen to at least have the right plan before I go ahead and disconnect from the old PR hosting solution (causing the team issues).
Can anybody give me some pointers please?


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