nginx服务器 server location映射路径配置

•location映射(ngx_http_core_module)
– location [ = | ~ | ~* | ^~ ] uri { ... }
– location URI {}:
– 对当前路径及子路径下的所有对象都生效;
– location = URI {}: 注意URL最好为具体路径。
– 精确匹配指定的路径,不包括子路径,因此,只对当前资源生效;
– location ~ URI {}:
– location ~* URI {}:
– 模式匹配URI,此处的URI可使用正则表达式,~区分字符大小写,~*不区分字符大小写;
– location ^~ URI {}:
– 不使用正则表达式
– 优先级:= > ^~ > ~|~* > /|/dir/
–/loghaha.html
–/logheihei.html
–^/log.*html$

posted @ 2019-06-11 21:14  HandsomeEric  阅读(3807)  评论(0编辑  收藏  举报