I have an app hosted on Render - that allows users to create their own webpages based on unique URLs.
For example:
–//---------------------------/website/12345 - URL webpage with custom Data that belongs to User1
----//--------ending with /website/22233 - URL webpage with custom Data that belongs to User2
And so on…
My question:
What’s the best way to allow users - to assign Custom Domains - to their webpages on my APP?
Welcome to the Render community! There are a few possible solutions for providing your users with custom domains depending on how you set things up:
You can have your users create a CNAME record that targets myapp.render.com (it wouldn’t be the IP address of your service but the domain name itself). Then, in your application, you can inspect the Host header to see which domain corresponds.
If the sites you are providing your users are static sites, you can set up a static site in front of your web service and have your users create a CNAME record that targets mystaticsite.render.com and create a rewrite rule for every request to your backend service. Then inspect the X-Forwarded-Host header to find the domain.