xinghe0 发表于 2018-11-12 10:25:51

nginx Location相关学习笔记

  http://localhost/qunying/location.html
  root:
  location /qunying/ {
  root/data/web/ ;
  }
  alias:
  location /qunying/ {
  alias/data/web/qunying/ ;
  }
  file: /data/web/qunying/location.html
  location中路径和用户发起的http请求的url地址要对应,
  root的最后一个“/”要同location的第一个“/”对应,其他目录结构同location中剩余部分相同。
  alias的最后一个“/”要同location的最后一个“/”对应
  location优先级:
  (location =) > (location 完整路径匹配 >) >(location ^~ 路径) >(location ~* 正则) >(location 路径)

页: [1]
查看完整版本: nginx Location相关学习笔记