Score:0

How to configure Cloudflare DNS for path based routes with a target like how you define for a CNAME record?

jp flag

I have a site, lets call it mydomain.com. The site has some subdomains (subdomain.mydomain.com) and some path based routing (mydomain.com/path1). The thing is that when a user clicks on links to either those subdomain or path based routes the website should open up a new app, but still appear with the same root domain (mydomain.com)

For subdomain, I got that down no problem. Just create a CNAME record with the Name field = subdomain_name and the Target = myTarget (which in this case is a AWS CloudFront distribution). This works perfect. A user selects a link and the site navigates to the subdomain, which is actually a brand new SPA served up by AWS CloudFront+S3.

What I can't figure out is what record to create for the apps that get deployed by the path-based routes. For example a user selects a link and the front-end navigates to mydomain.com/somePath and when it does I need Cloudflare to target another CloudFront+S3 distribution that has it's own SPA deployed there.

If anyone can explain how to handle path based-routing in Cloudflare with targets like CloudFront it would be much appreciated, because I am stumped on this!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.