Sangoku Sangoku - 24 days ago 20
Apache Configuration Question

Apache Proxy balancer overuling file access limits

I have 1 load balancer server and 2 app servers which do load distribution. Now i have a strange problem that the

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>


rule dous not get triggerd when the request gets forwarded to the app servers.

Setup is:

<Proxy balancer://catdefault>
BalancerMember http://xx.xxx.xxx:8081
BalancerMember http://xx.xxx.yyy:8081
</Proxy>


And in the virtual host i get it included like this:

ProxyPass / balancer://catdefault/
ProxyPassReverse / balancer://catdefault/




The strange thing is that when i apply the Files rule in the app server which is a balance memger ex. http://xx.xxx.xxx:8081 then the rule gets respected.

Now we agreed not to makie rew rulles on the app server because they will be later or many of them and administration will be heavy.

Any idea how i can make the files work from the load balancer server and not the http://xx.xxx.xxx:8081 servers???

Answer

<Directory> or <Files> directives will only apply to objects that reside in the filesystem. Perhaps something like this can help (untested):

ProxyPassMatch "(?i)\.ht([^/]*)$" ! 
ProxyPass / balancer://catdefault/
ProxyPassReverse / balancer://catdefault/
Comments