Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Apache as a load balancer for application requests, but I would like it to serve static requests itself. At the moment, everything is getting passed through to the back-end servers. I'm sure that this is something simple, but I can't get the incantation right. My current configuration looks like:

Alias /static "C:/path/to/my/static/files"
<Location "/static">
  SetHandler None
  Options Indexes
  Order allow,deny
  Allow from all    

<Proxy balancer://mycluster>
    BalancerMember http://foo:9000 route=0
    BalancerMember http://bar:9001 route=1
    BalancerMember http://baz:9002 route=2

<Location />
    Order Allow,Deny
    Allow from all
    ProxyPass balancer://mycluster/
share|improve this question
After reading the Apache docs more carefully, several times, I realize that the "Location /static" bit should be "Directory static", and that the "Location /" bit is overriding ALL the other settings anyway. I'm trying to get something like LocationMatch "(?<!\.css|\.png>)$" working, but now EVERYTHING is getting sent locally. – Chris Curvey Feb 25 '11 at 18:04
up vote 1 down vote accepted

You might need to re-work the configuration a bit but adding an exclamation point at the end of a proxypass statement is supposed to prevent proxying of that subdirectory. For example, something like:

ProxyPass /static !
ProxyPass / balancer://mycluster/
share|improve this answer
that did it! Just had to pull out the <Location /> block and it worked like a charm! – Chris Curvey Mar 8 '11 at 2:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.