We have a Centos server with a number of virtual hosts, and my rails app
runs under one of those virtual hosts using mongrel_rails. The app lives
in /home/mydomain/railsapp where /home/mydomain/railsapp/public is the
It runs under mongrel on port 8008, so to get to it users invoke the url
http://www.mydomain.com:8008/ - all is fine to this point.
Now I have some users whose firewalls forbid these semantics, so I went
and configured apache (v1.3) to have mod_proxy in an attempt to get the
:8008 out of the URLs the user submits.
With a simple rule like:
It works beautifully when the user invokes http://www.mydomain.com. I
believe all my paths within the app are relative to the rails root. Now
here is the PROBLEM.
I cannot use ‘/’ for the proxy since mydomain.com needs to work for the
website that already predates the rails app, and in fact wants to offer
it to it’s users. So I changed the mod_proxy rules in apache to:
I did this in hopes users could specify http://www.mydomain.com/myapp/
Well this works but the problem is that all the links I created using
the link_to method do not invoke
the merely are relative hrefs that look like
and as a result do not go to the proper pages.
How do I fix this? Why is it different when I specify a subdir versus
just specifying ‘/’ in my proxy? I have tried using:
ActionController::AbstractRequest.relative_url_root = “/myapp” and it
just does not help. I am extremely confused and tired. I can’t help but
feel I’m getting close. It’s taken the last 2 days to get mod_proxy
working. Any help is appreciated.