views:

266

answers:

2

I really like Basecamp's idiom of "dynamically" creating custom virtual hosts for clients -- for instance, once a company has signed up they may quickly login to a special URL like:

https://mystartup.basecamphq.com/

--which I think is really neat, it segregates multiple organizations nicely within a single application. My question is: assuming I've got control of a given domain, is there an easy way to do this kind of black magic with Rails and Nginx -- that is, to dynamically create a virtual host?

A: 

Most cases you are not truly creating a virtual host. You created a subdomain one time that then accepts ANY sub-domain off of it and you pipe it to your back end for processing (404, 302, or 200).

do a search on "nginx wildcard subdomain". The results from slicehost are usually very helpful.

Off Rhoden
A: 

How to do Basecamp-style subdomains in Rails

Also:

Simone Carletti
Very nice, up and running in minutes.
Joe