1

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

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

<Location />
    Order Allow,Deny
    Allow from all
    ProxyPass balancer://mycluster/
</Location>
Chris Curvey
  • 359
  • 1
  • 2
  • 9
  • 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

1 Answers1

1

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/
mahnsc
  • 1,796
  • 13
  • 11