我在Apache 2.4上的vhost配置有问题。我使用apache作为反向代理并转发所有内容(“ /”),但我想为一个子目录实现基于ip的限制。所以我所做的是:
<Proxy "balancer://ucpcluster">
BalancerMember "http://backend.com:6000"
BalancerMember "http://backend.com::6000"
BalancerMember "http://backend.com::6000"
#Loadbalancer-Mode: byrequests, bytraffic, bybusyness
ProxySet lbmethod=byrequests
</Proxy>
<Location /healthcheck>
SetEnvIf X-Forwarded-For xxx.xxx.xxx.*$ allow_ip
SetEnvIf X-Forwarded-For xxx.xxx.xxx.xxx$ allow_ip
Require env allow_ip
ProxyPass "http://backend.com:6009/healthcheck"
ProxyPassReverse "http://backend.com:6009/healthcheck"
</Location>
ProxyPass "/" "balancer://ucpcluster/"
ProxyPassReverse "/" "balancer://ucpcluster/"
但是当我访问/ healthcheck并查看日志时,从未输入/ healthcheck的Location指令
有人可以帮忙吗?谢谢!