Set a default variable in nginx with set
map $foo $new_foo {
default $foo;
'' bar;
}
or
if ($foo = '') {
set $foo bar;
}
- http://nginx.org/r/map
- http://nginx.org/r/if
map $foo $new_foo {
default $foo;
'' bar;
}
or
if ($foo = '') {
set $foo bar;
}