Set up custom domains for users using rails 4, nginx with passenger Set up custom domains for users using rails 4, nginx with passenger nginx nginx

Set up custom domains for users using rails 4, nginx with passenger


What you're looking for is something called "virtual subdomains" (I think). Here is some information about how to set them up:

You basically need to set up a "wildcard" subdomain in your DNS (which will route all subdomain requests to your app), and let the routing middleware handle the request (& route accordingly)


Domains

Considering the updates, I have had a look online for you:

I don't have experience of this directly, but I'd say you first need to get the domain to point to your site (with CNAME changes). This could then be caught by your routing middleware (as described in the link above), allowing you to "route" the request accordingly

Heroku does this exact thing - it's quite common