【发布时间】:2021-04-19 19:06:47
【问题描述】:
在我的server 指令中,位置配置如下
location ~ \.(html)$ {
expires max;
return 200 "case sensitive match";
}
location ~* \.(html)$ {
expires 10d;
return 200 "case insensitive match";
}
我的期望是,当我加载localhost/somthing.html 时,它应该打印case sensitive match,当我加载localhost/something.hTML 时,它应该打印case insensitive match
但是,在这两种情况下,case sensitive match 都会被打印出来
access.log的请求日志是
127.0.0.1 - - [18/Apr/2021:17:56:15 +0530] "GET /something.hTML HTTP/1.1" 200 20 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15"
附加图片,请参阅打印的声明以及设置为MAX 的expires,证明case sensitive match 有效。这里可能出了什么问题?
【问题讨论】:
-
nginx在什么操作系统下运行?
-
Mac,大苏尔,11.2.3
标签: nginx nginx-config