Syntax: if (condition) { ... } Default: — Context: server, location
The specified condition is evaluated. If true, this module directives specified inside the braces are executed, and the request is assigned the configuration inside the if directive. Configurations inside the if directives are inherited from the previous configuration level.
A condition may be any of the following:
a variable name; false if the value of a variable is an empty string or “0”; Before version 1.0.