开发者

Dynamically Create Virtual Hosts with Rails, Nginx?

I really like Basecamp's idiom of "dynamically" creating custom virtual hosts for clients -- for instance, on开发者_如何学编程ce 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?


How to do Basecamp-style subdomains in Rails

Also:

  • Subdomain accounts with Ruby on Rails explained


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜