httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] do not proxy static files
Date Thu, 14 Dec 2006 18:21:14 GMT
On 12/13/06, Xavier Noria <fxn@hashref.com> 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.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message