Fixing routes when Rails app is subdirectory

If I have Apache configured to proxy /foo to Rails behind Mongrel, how
do I fix routes to always include the subdirectory?

In other words, main Rails page is here:

http://127.0.0.1/foo/

But application environment page fails because it’s here

http://127.0.0.1/foo/rails/info/properties

not here

http://127.0.0.1/rails/info/properties