Custom domain for "preview" branches not working as expected

Hi,

We are attempting to create a "staging" domain for one of our projects. We want any code deployed under the "staging" (preview) branch to be accessed via this domain (https://cal-staging.nylas.com).

We followed the instructions found here:
https://developers.cloudflare.com/pages/how-to/custom-branch-aliases/

If we visit https://staging.nylas-calendar.pages.dev directly, the correct staging environment is rendered.

However, if we visit https://cal-staging.nylas.com the production environment is rendered.

However, we do not actually use CloudFlare for DNS management. We are actually using Route53 for our root domain (nylas.com). Is this the reason why our setup isn't working? Just in case, we still created a "DNS entry" in our CF DNS management of nylas.com for cal-staging.nylas.com that points to https://staging.nylas-calendar.pages.dev/

Thanks!
Cloudflare Docs
In this guide, you will learn how to add a custom domain (staging.example.com) that will point to a specific branch (staging) on your Pages project.
Was this page helpful?