在 nginx 中我可以set用来定义一个变量,但是可以定义一个默认值吗?
例如
set $foo bar if $foo is not defined
Run Code Online (Sandbox Code Playgroud)
VBa*_*art 16
map $foo $new_foo {
default $foo;
'' bar;
}
Run Code Online (Sandbox Code Playgroud)
或者
if ($foo = '') {
set $foo bar;
}
Run Code Online (Sandbox Code Playgroud)