httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <>
Subject Re: [users@httpd] do not proxy static files
Date Thu, 14 Dec 2006 18:21:14 GMT
On 12/13/06, Xavier Noria <> wrote:
> I am using mod_proxy_balancer to balance Mongrels in localhost. I am
> putting lines like
>    ProxyPass /images/ !
> to let Apache serve static files, but that couples the config with
> the application layout. I would prefer to be able to simply say:
>    if file exists
>      let Apache send it
>    otherwise
>      ProxyPass to Mongrel
>      ProxyPassReverse
>    end
> Is that possible?

Yes, with mod_rewrite.  Something like
RewriteEngine On
RewriteCond         /your/docroot/%{REQUEST_FILENAME} !-f
RewriteRule  ^(.+)  http://mongrel/$1  [P,L]
ProxyPassReverse / http://mongrel/

Use the RewriteLog to debug.

But I wouldn't really recommend this.  It can be a fragile
configuration, and it will require local filesystem access on every
request, which will be slow for a busy server.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message