[Mongrel] Mongrel servers running in a subdirectory behind a proxy

Joey Geiger jgeiger at gmail.com
Thu Aug 10 14:12:00 EDT 2006

I was able to find some information about this in the list archives,
but it ended with a possible patch being submitted for Mongrel.

I tried to follow a few of the instructions, but I'm still kind of
stuck, since I'm not sure if what I'm seeing is the proper results. I
have an application running on a cluster of mongrel servers, which is
behind pen, which in turn is behind an apache 1.3 mod_proxy.
apache >> proxypass /app >> pen(8000) >>
mongrel_cluster (8001-3)

I'm using mongrel_cluster, so I added "prefix: /app" into the cluster
configuration, but I'm not sure if it's doing anything, as the routes
generated by rails are still /user/index and not /app/user/index

As part of the information in previous posts, I found this possible
solution, but I wasn't sure if I need to do both at the same time.
#make rails think it lives in /app
ActionController::AbstractRequest.relative_url_root = "/app"

Also the above setting has a bad side effect that if makes the images,
stylesheets, javascripts think they are in /app, even when using the
external host setting below.
# Enable serving of images, stylesheets, and javascripts from an asset server
config.action_controller.asset_host = "http://assets.example.com"

Thanks for any help you can supply.

More information about the Mongrel-users mailing list