Does anyone know how to use Mongrel to create virtual hosts? My
production site will have all kinds of domains pointing to it, and I
also need to figure out how to do subdomains. Rails should react to
the host name, doing a lookup based on the name and pull different
records from the database based on this.
You might consider switching to Passenger for stuff like this. This is
how our team is tackling this without much effort. Takes just a few
minutes to setup/switch. Here is a writeup on it (for OS X).
Does anyone know how to use Mongrel to create virtual hosts? My
production site will have all kinds of domains pointing to it, and I
also need to figure out how to do subdomains. Rails should react to
the host name, doing a lookup based on the name and pull different
records from the database based on this.
Typically people use nginx, apache etc… to handle the nuts and bolts
side of virtual hosts. There’s railscasts on using subdomains
(#123 Subdomains - RailsCasts
)
Mongrel will respond to everything with the same app. The app, however
has access to A request.env variable which has hostname in it. Inspect
it to find out more.