1 虚拟主机优先级

   ls 查看的文件,先读取的配置 作为

2 location匹配优先级

   https://www.cnblogs.com/eason-d/p/7657705.html

3: try files  使用

   

  首先判断 $uri 文件是否存在, 若不存在给$uri/加个/ 

  

  用于缓存的场景, 动静分离的场景 判断文件是否存在.

  

4 root 和 alias区别

    root 会把location的地址组合起来, 比如

  location /download {

    root /opt/app/code

  }

  如上找的文件地址是/opt/app/code/download目录下的文件

  alias 会把locatioin的地址忽略

  location /download {

    alias /opt/app/code

  }

  如上找的文件地址是/opt/app/code录下的文件

5 传递真实IP

  

  remote_addr 获取的是代理IP

  remote_x_forward_for 

 

  代理头部IP透传

  set x_real_ip=$remote_addr

  

6 常见错误

  

 

posted on 2019-07-23 12:26  1161588342  阅读(80)  评论(0)    收藏  举报