0

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?

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
Joseph Weissman
  • 5,697
  • 5
  • 46
  • 75

2 Answers2

0

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.

Daniel Rhoden
  • 6,117
  • 6
  • 26
  • 28
0

How to do Basecamp-style subdomains in Rails

Also:

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364