Does unicorn support mount the webapp with a prefix like Thin does?

Eric Wong normalperson at yhbt.net
Mon Mar 21 12:14:10 EDT 2011


Guang-Nan Cheng <chenggn at gmail.com> wrote:
> For example, I have a webapp that handles /welcome.
> 
> Does unicorn support to mount the entire webapp at /prefix so request
> to /prefix/welcome are handled?

Yes, all Rack servers that support rackup (config.ru) files can do it:

  map "/prefix" do
    use Rack::Chunked
    run WelcomeApp.new
  end
  # ...
  map "/lobster" do
    use Rack::Lint
    run Rack::Lobster.new
  end
  # You can do virtual hosts, too:
  map "http://example.com/" do
    run ExampleApp.new
  end

See the Rack::Builder and Rack::URLMap RDoc for more info.

-- 
Eric Wong


More information about the mongrel-unicorn mailing list