lundi 19 février 2018

How to do complex multiple conditions test in nginx?

I googled, and get something like this:

if ($request_method = POST) { 
  set $test  A; 
} 

if ($http_x_asdf = "fdsa") { 
  set $test  "${test}B"; 
} 

if ($test = AB) { 
  //***;
} 

It looks really ugly, how to do it more elegantly?

I was told that map can do that, I searched and read, but still don't know how to do it.




Aucun commentaire:

Enregistrer un commentaire