各位老哥 都说精确匹配优先级高 为什么是通用匹配匹配到了? 我很郁闷
如果我把通用匹配去掉了 留下精确匹配 浏览器无法找到 直接跳转到nginx欢迎页面
各位老哥 都说精确匹配优先级高 为什么是通用匹配匹配到了? 我很郁闷
如果我把通用匹配去掉了 留下精确匹配 浏览器无法找到 直接跳转到nginx欢迎页面
来,看看官网给的说明:
http://nginx.org/en/docs/http...
Let’s illustrate the above by an example:
location = / {
[ configuration A ]
}
location / {
[ configuration B ]
}
location /documents/ {
[ configuration C ]
}
location ^~ /images/ {
[ configuration D ]
}
location ~* \.(gif|jpg|jpeg)$ {
[ configuration E ]
}
The “/” request will match configuration A, the “/index.html” request will match configuration B, the “/documents/document.html” request will match configuration C, the “/images/1.gif” request will match configuration D, and the “/documents/1.jpg” request will match configuration E.
2 回答2.5k 阅读✓ 已解决
1 回答1.8k 阅读✓ 已解决
1 回答1.2k 阅读✓ 已解决
3 回答1k 阅读
1 回答739 阅读
568 阅读
因为你访问的是
/index.html
不是/
。