Directory 和 Location 的区别

noteId: WEB08970538c5910e2ca3745262c2172f5f · 原始路径:/ALL/Linux - A模块/服务配置/Apache2/Directory 和 Location 的区别.note

1、<Directory> 和 <Location> 的区别:

<Directory> 和 <Location> 的区别:1、<Directory> //本地真实路径,例如:/var/www/html只对真正本地存在的目录生效适合做:文件访问权限SSL客户端证书验证PHP、CGI文件下载控制不能做:反向代理2、<Location> //URL路径,例如:/managers(表示:https://www.wsc2024.fr/managers)不关心磁盘路径,即使/managers不是真实目录也会生效适合做:API认证、反向代理可以配置 Alias使用(Alias /managers /data/www)