3

I can't find in docs how I can do negative statement like one below:

if !($some_var) {
  ... enter here if $some_var doesn't exist or empty
}

I know that I can check that the variable is exits using the if statement:

if ($some_var) {
  ...
}

But I can't find how to do if not statement

Is it possible for NGINX?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Klimbo
  • 1,308
  • 3
  • 15
  • 34

1 Answers1

1

Try this:


if ($var = false) {
     ....
}
jim smith
  • 2,394
  • 5
  • 29
  • 35