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>
1
  • 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. Feb 25, 2011 at 18:04

1 Answer 1

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/
1
  • that did it! Just had to pull out the <Location /> block and it worked like a charm! Mar 8, 2011 at 2:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .