我正在尝试通过 ip 设置 apache 限制。
如果阻止自己或仅接受其他 IP,我在我的 IP 上进行了测试。
Apache重新启动,我真的不知道可能是哪个问题
尽管有限制,我仍然可以在页面上访问
我在网上找到的所有示例如下:
<Location /home>
SetEnvIf X-Forwarded-For ^xxx\.xxx\.xxx\.xxx access
Order allow,deny
Satisfy Any
Allow from env=access
</Location>
<Location /home>
Order Deny,Allow
Deny from All
Allow from xxx.xxx.xxx.xxx
Deny from All
Satisfy Any
</Location>
<ProxyMatch "/home/*" >
Order Deny,Allow
Deny from all
Allow from xxx.xxx.xxx.xxx
</ProxyMatch>
<LocationMatch "/home">
Order Allow,Deny
Allow from all
SetEnvif X-Forwarded-For "xxx\.xxx\." DenyAccess
Deny from env=DenyAccess
</LocationMatch>
<Location "/home">
Order Allow,Deny
Allow from all
SetEnvIf X-Forwarded-For ^xxx\.xxx\. denyAccess
Deny from env=denyAccess
</Location>
<Location "/home">
SetEnvIf X-Forwarded-For ^xxx\.xxx\. access
Order allow,deny
Satisfy Any
Allow from env=access
</Location>
谢谢