You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Xavier Noria <fx...@hashref.com> on 2006/12/13 23:56:53 UTC

[users@httpd] do not proxy static files

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?

-- fxn


---------------------------------------------------------------------
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


Re: [users@httpd] do not proxy static files

Posted by Joshua Slive <jo...@slive.ca>.
On 12/13/06, Xavier Noria <fx...@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