这是一个创建于 2031 天前的主题,其中的信息可能已经有所发展或是发生改变。
location ~ "/test-p15990\.html$" {
if ( $whitelist = 0 ) {
set $test 1;
}
default_type "text/html; charset=UTF-8";
add_header debug "test1";
try_files /html/p15/990 =404;
}
注销第 2 和第 4 行就正常返回页面,说明设置变量没有问题,如果$whitelist 为 1 时是正常的。
但问题是当$whitelist 为 0 时就不行了呢?
5 条回复 • 2019-04-01 13:22:59 +08:00
|
|
1
uncat 2019-04-01 09:48:56 +08:00 via iPhone
优先级问题,后者高
|
|
|
3
mcfog 2019-04-01 11:10:35 +08:00
|
|
|
4
no1xsyzy 2019-04-01 11:29:09 +08:00
我猜应该是 try_files 没有被 if 配置块继承。
|
|
|
5
zhaoyc2018 2019-04-01 13:22:59 +08:00
add_header 也没有用,看来就是 @ mcfog 所说的问题。。。 谢谢各位
|