[Nitro] use /somedir as application root?

Stephan Mueller d454d at web.de
Sun Sep 10 05:09:29 EDT 2006

* Fabian Buch <fabian at oggu.de> [10.09.2006]:
> Am 09.09.2006 um 18:56 schrieb Stephan Mueller:
> > is there a recommended way to run a nitro app designed to work on  
> > "/" on
> > a subdir, say "/my_app" with nitro 0.31?
> sure:
> Nitro::Server.map['/my_app'] = MyAppController
> in your run.rb

huh, yeah. My server map looked like this:

Server.map = {'/' => TodoController, '/tags' => TagController, '/admin'
=> AdminController, '/items' => ItemController ...

I changed these entries to include a prefix "/todo" ("/" becomes
"/todo", "/items" => "/todo/items" and so on). But this introduced
a couple of problems. Actions of the different controllers did not get
recognized correctly (eg. /todo/item/edit?oid=1) and so on.

The mapping of actions seems to work only at the first level. It gets
better when using /todo/item__edit... instead but even this leads to
some problems with the handling of request parameters etc. 

The intention of using a subdir was to be able to use proxying in apache
to my app on a non root url (eg. proxy /todo http://my.webrick/todo).

What I have now is the following:
All links in the app include now the full path the the external apache. The
controllers are maped relative to "/" as before. Finally to get the right
mapping I use the Router.strip_path setting.



More information about the Nitro-general mailing list