例子1
location /test_1 {
return
400;
}
location ^~
/test {
return
401;
}
如上如果path为/test_1,返回的是400,说明^~优先级并不比普通匹配高
例子2
location /test_1 {
return
400;
}
location ^~
/test {
return
401;
}
location ~
/test {
return
402;
}
如上如果path为/test_1,返回的是402,此时^~和普通匹配只记住了最长一个location /test_1,不会阻止正则
如果path为/test,返回401,此时^和普通匹配只记住了最长一个location ^ /test,会阻止正则
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。