On Wed, 2006-05-10 at 16:24 +0100, Paul Wright wrote:
> On 10/05/06, Paul Wright <[EMAIL PROTECTED]> wrote:
> > All that's left now is working out how to set the environment variable
> > RAILS_RELATIVE_URL_ROOT...  Any clues?
> 
> Just in case anyone else is following along, I found the solution to
> be to add the following line to the top of my config/routes.rb above
> everything else:
> 
> ActionController::AbstractRequest.relative_url_root = "/rails"
> 
> And then alter my apache config to look like this:
> 
> RewriteEngine On
> # Punt any pontential 404s to the proxy
> RewriteCond %{REQUEST_FILENAME} ^/rails/.*
> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
> RequestHeader set X_FORWARDED_PROTO 'https'
> RewriteRule ^/(.*)$ balancer://proxy_group/$1   [proxy]
> 
> Thus the full request_filename is given to mongrel (including the
> preceeding /rails/) and it knows what to do with it because of the
> additional line in routes.rb.

Thanks Paul, this is great stuff.  I'll be sure to include it in the
deploying to apache documentation.


-- 
Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/


_______________________________________________
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to