[Mongrel] Expert feedback needed

13 one.three at gmail.com
Mon Oct 2 07:22:29 EDT 2006


Hi Jens,

Yes I am sure that static files are served by apache. I have checked
it using both mongrel debug mode and curl.

I'm not sure why would I need to forward requests, for files that
apache can serve, to mongrel so I will stay with my configuration
until someone proves me wrong.

As I said before I'm not an apache expert, but your last rule looks
like misuse of mod_rewrite. Isn't it like that last rewrite rule does
what ProxyPass + ProxyPassReverse are supposed to do ?

--
Martins

On 10/2/06, Jens Kraemer <kraemer at webit.de> wrote:
> Hi!
>
> On Mon, Oct 02, 2006 at 09:46:12AM +0300, 13 wrote:
> [..]
> > > >       RewriteEngine On
> > > >
> > > >       # Check for maintenance file. Let apache load it if it exists
> > > >       RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
> > > >       RewriteRule . /system/maintenance.html [L]
> > > >
> > > >       # Let apache serve static files
> > > >       RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
> > > >       RewriteRule (.*) $1 [L]
> > > >
> > > >       # Don't do forward proxying
> > > >       ProxyRequests Off
> > > >
> > > >       # Enable reverse proxying
> > > >       <Proxy *>
> > > >               Order deny,allow
> > > >               Allow from all
> > > >       </Proxy>
> > > >
> > > >       # Pass other requests to mongrel instance
> > > >       ProxyPass / http://127.0.0.1:8200/
> > > >       ProxyPassReverse / http://127.0.0.1:8200/
>
> Are you sure this setup serves static files via Apache? Imho the
> ProxyPass directives should be executed regardless of the outcome of
> your rewriting, forwarding all requests to mongrel.
>
> I usually use the rewriting the other way around, without any ProxyPass
> directives:
>
>     # Don't do forward proxying
>     ProxyRequests Off
>
>     # Enable reverse proxying
>     <Proxy *>
>       Order deny,allow
>       Allow from all
>     </Proxy>
>
>     RewriteEngine On
>
>     # Check for maintenance file. Let apache load it if it exists
>     RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
>     RewriteRule . /system/maintenance.html [L]
>
>     # Rewrite index to check for static
>     RewriteRule ^/$ /index.html [QSA]
>
>     # Let apache serve static files (send everything via mod_proxy that
>     # is *no* static file (!-f)
>     RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
>     RewriteRule .* http://127.0.0.1:8200%{REQUEST_URI} [L,P,QSA]
>
>
> the P option to the last rule replaces the ProxyPass and
> ProxyPassReverse directives.
>
> Jens
>
>
> --
> webit! Gesellschaft für neue Medien mbH          www.webit.de
> Dipl.-Wirtschaftsingenieur Jens Krämer       kraemer at webit.de
> Schnorrstraße 76                         Tel +49 351 46766  0
> D-01069 Dresden                          Fax +49 351 46766 66
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>


More information about the Mongrel-users mailing list