mardi 13 février 2018

Test if 0 or 1 in a condition with nginx

I start in nginx. I have a variable $testLocal which takes the value '0' or '1'.

$testLocal     1             OR
$testLocal     0

I want to test this variable in an condition, like this:

if ($testLocal = 1) {
  echo "LOCAL";
} 
else {
  echo "NOT LOCAL";
}

I have an error 404 :

2018/02/13 11:29:13 [error] 11626#0: *3673 open() "/var/www/html/_matrix" failed (2: No such file or directory) while sending to client, client: 127.0.0.1, server: _, request: "GET /_matrix HTTP/1.1", host: "nxs_dev_flo2.nexus.fr"

Aucun commentaire:

Enregistrer un commentaire