Guang-Nan Cheng
2011-Mar-21 07:37 UTC
Does unicorn support mount the webapp with a prefix like Thin does?
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?
Edho P Arief
2011-Mar-21 08:34 UTC
Does unicorn support mount the webapp with a prefix like Thin does?
On Mon, Mar 21, 2011 at 2:37 PM, 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, it does. I don''t remember exactly how though as my main server is currently offline (it has the config and all). Probably using --path or something.
Eric Wong
2011-Mar-21 16:14 UTC
Does unicorn support mount the webapp with a prefix like Thin does?
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
Jason Heiss
2011-Mar-30 18:19 UTC
Does unicorn support mount the webapp with a prefix like Thin does?
On Mar 21, 2011, at 12:37 AM, Guang-Nan Cheng 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?If it is a Rails app you can put the following in your unicorn config file: ENV[''RAILS_RELATIVE_URL_ROOT''] = ''/prefix''