简体   繁体   中英

Allow users to CNAME to custom subdomain on Heroku App

This may have been answered before (it seems relatively common) but for the life of me I cannot find it, so here we are.

I'm creating a relatively straightforward Ruby on Rails app and am (was?) planning on hosting it on Heroku since I'm already setup there.

The problem I'm having is that I'm creating a landing page builder that needs to allow users to view their website at something like https://their-app.my-app.com . Of course, there will be users who will also want to point their own domains (ex. their-app.com ) to that subdomain via a CNAME.

1) Is it possible on Heroku to do that without having to add each one as a custom domain (which of course isn't realistic due to customers being able to add their own).

2) Any recommendations on which service might be the best for hosting this kind of setup? I really love the heroku PaaS setup but of course.. this is a requirement.

Side note: WHen doing it now (Creating a CNAME to point a domain name at the subdomain my app created) I currently get a Heroku page saying "No App Found at this Domain", etc.

Thanks!

Yes, this is doable and automatable on Heroku.
Using the Heroku Platform API , you can programmatically point domains to an app.

Then, your customer will have to point their domain to the value of the cname attribute provided by Heroku.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM