常见匹配方式
=
^~
/
~
~*
@
优先级
= 精确匹配
^~、/ 普通字符匹配
~、~* 正则表达式匹配
= > 完整路径 > ^~ 路径 > ~、~*正则 > 部分起始路径> /
只匹配/ 优先级比location /低
location = / {
}
只会匹配/index.html 优先级高
location = /index.html {
}
优先级最低
location / {
}
匹配任何以/images/开头的请求
location = /images/ {
}
匹配已这些结尾的请求
location ~ . * .(html|txt|gif)$ {
}