Forum: Ruby on Rails ANN: Reverse_Proxy_fix

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Brian H. (Guest)
on 2006-05-10 19:24
(Received via mailing list)
I've been working for the last few months on methods to place Rails
applications behind Microsoft's IIS web server. It's not the easiest
to do.

One of the biggest hurdles when placing Rails apps behind reverse proxy
servers is the fact that when Rails generates URLs with the built-in
like link_to and url_for, they could end up exposing the internal URLs
instead of the ones you want your users to go through.

I've developed a plugin that will handle the rewriting for you. All you
to do is install the plugin, provide the appropriate base URL to the
file, and then launch your application in production mode/

Key features:
 * Only runs in production mode so your development can still proceed
the plugin is installed
 * You specify the path (protocol, server, and base folder) that you
prepended to the URLs created by Rails.

You can install it via svn. Upon installation, the install script will
you for a base url. Enter it without the trailing slash (
If you need to change it later, you can run the install.rb script in the
plugin folder or just directly modify lib/config.rb.

ruby script/server plugin install

This seems to work very well for our applications... we've been using it
a month now on three separate applications.

I would appreciate comments or feedback on this. I doubt it will be that
useful to most people but it's nice when you need it.
This topic is locked and can not be replied to.