/ nginx / docs / nginx-constraints
Constraints of NGINX if
block
If
is EVIL
- Orginal article why NGINX has these constraints. As they mention:
The only 100% safe things which may be done inside if in a location context are:
return …; rewrite … last;
and set variables value - like set $allow "${allow}n";
Other constraints
- No if inside if.
- Allowed in specific scopes server, location.
No multiple operators
- No OR, no AND, nothing.
- Workaround