How to do multi-tenant support with custom domains and SSL on Heroku
Asked Answered
M

0

8

My app allows users to create custom product landing pages.

I wish to setup this scenario:

Pages can exist on brand.myapp.com/offer-name, however I want to enable users to create landing pages using their own domain, for example brand.customerdomain.com/offer-name, which serves a page from my app.

I am unsure about the best way to do this. I know I can have users point a CNAME record to 'myapp.com', and then I add 'brand.customerdomain.com' as a Heroku custom domain. But is there a limit to the amount of custom domains I can add to Heroku? There will be thousands of these domains, so I don't know if this solution is feasible. I have had some success with this approach, however I get SSL browser messages when accessing the page from the user's domain.

In terms of SSL, I have a wildcard certificate installed on Heroku, for *.myapp.com.

Another way is to have a proxy server hosted elsewhere, and have users point a CNAME to something like 'proxy.myapp.com', which routes to my Heroku URL, however I haven't been able to get this to work on Nginx (on DigitalOcean), and haven't found any suitable guides (I don't have much Nginx knowledge).

The proxy approach I found here - https://mrvautin.com/enabling-custom-domain-for-saas-application-on-heroku/.

Cloudflare has a solution for this problem, however it's available to enterprise customers only, so I'd prefer to have my own solution - https://www.cloudflare.com/saas/.

What would be the ideal way to have multi-tenancy, with custom domains and SSL on Heroku?

Madelynmademoiselle answered 6/10, 2017 at 12:21 Comment(1)
Did you solve this problem?Farrel

© 2022 - 2024 — McMap. All rights reserved.