This still doesn't seem quite right--how does url_for work right if
the back end doesn't know where it actually lives?  Does the proxy
have to rewrite all HTML passing through it?  I know that there's a
module for that for Apache (mod_proxy_html), but it requires a lot
more work then normal proxying.  It'd be a lot cleaner if we could
generate the right HTML in the first place.

>From http://dev.rubyonrails.org/ticket/2602, it looks like
request.relative_url_root is the method that I was looking for inside
of Rails.  It has special-case support for Apache--it spots
dispatch.fcgi in the request path and calculates the correct root on
its own.  I'll take a look at patching mongrel_rails to add a --prefix
flag and then pass the path onto the Mongrel::Rails.


Scott

On 7/10/06, Neil Wilson <[EMAIL PROTECTED]> wrote:
> -----Original Message-----
> From:    [EMAIL PROTECTED]    [mailto:[EMAIL PROTECTED] Behalf Of Scott    
> Laird
> Sent: 10 July 2006 21:42
> To:    [email protected]
> Subject: Re: [Mongrel] Rails app in a    subdirectory via Mongrel
>
>
> Er, okay.  The thing is, this is *trivial* with Apache and    fcgi--just add 
> 'RewriteBase /blog/' to your usual rewrite config and it Just    Works.  
> Routes work correctly in both directions.
>
>
>
> So    can you not do the same with the proxy? Mongrel is a replacement for    
> FCGI, not the Apache/FCGI pair.
>
> If    Rails knew which prefix it lived on and could generate all its refer 
> and    redirect URLs relative to that prefix rather than just root, then you 
> wouldn't    need a rewriter proxy - Mongrel could just pass the URL in and 
> out    unadulterated. Should Rails know where it lives in the URL tree 
> though? Is    that the job of the application or the web server?
>
> Perhaps the solution    to the 'loads of http proxy front ends' is to 
> consider that none of them are    fit for *our* purposes - much as FCGI 
> wasn't fit for the application server    purpose. Anybody got to the stage 
> where that itch is worth    scratching?
>
> NeilW
>
>
> _______________________________________________
> Mongrel-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/mongrel-users
>
>
_______________________________________________
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to