All threads / Hatchbox: How do I point a Godaddy Domain to a wildcard sub-domain?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Hatchbox: How do I point a Godaddy Domain to a wildcard sub-domain?

Arjun Rajkumar asked in Servers

I run my app on Hatchbox, and have successfully created subdomains for each user.
E.g.
user1.myapp.com
user2.myapp.com
user3.myapp.com
etc.
How do I point user 2's own website (two.com) to user2.myapp.com?

This is what I did:

1) On Godaddy DNS settings under two.com account, I added a CNAME with name 'community' and value 'user2.myapp.com'
So I thought when I visit 'community.two.com' it should display 'user2.myapp.com'.
But, instead it is displaying myapp.com.

Is there something I should add to the NGINX file on Hatchbox - saying 'community.two.com' and 'user2.myapp.com' are connected.

I remember when I was using Heroku - I had to add the domains on Heroku also. Just wondering how to fix this.

Any advice will be really helpful!

Thanks

Arjun

Solved. Got help from Chris via email.

If anyone is stuck on this --
"
A CNAME just tells your browser which server to talk to. You'll have to write the code in Rails to check the domain to see if it's yours or a customer's in addition to checking the subdomain. You'll want to check the domain first, if it's a customers' look up their account. If it's yours, look at the subdomain, then lookup the account.
"

Does Chirs have any tutorials on this? Essentially step by step how to let a user add their own domain name to a multitenancy app set up on Heroku? I understand there are lots is questions regarding amount of SSL certs etc that can be issued but I'd love to be able to allow users of a multi-tenancy app load their own domain into my app instead of using subdomains to the app?

I'm new to gorails but pretty much joined hoping I could find help on overcoming this problem. Can't find anything in tutorials in the way of creating this URL set up. Something similar to the Shopify approach would be great. A user can add their own domain instead of using a subdomain.

Thanks for any pointers.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,629+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.