Conditionals may be applied to STATUS CODE, SET VARIABLE, and REWRITE RULE feature directives only. The conditional applies before the directive, and determines if the directive is executed.

  1. Key

    The key usually is a variable, but can also be a pure string. If key is a pure string, it is highly recommend to enclose it in double quotes. Variables can be built-in Nginx variables, or user-defined with the SET VARIABLE feature directive. For a list of common Nginx variables see http://wiki.nginx.org/HttpCoreModule#Variables. Note that this list is not a complete list, there are additional Nginx variables not listed on that page. Additionally, the control panel interface supports auto-completion of common Nginx variables, simply type $ and a context menu of available keys will show. 

  2. Relational Operator

    The relational operator determines how the key and value are evaluated. If regular expression is selected, the value must be a valid PCRE regular expression. The less than < and greater than > operators are not supported. 

  3. Value

    Value can be a pure string, a variable, or a PCRE regular expression. If value is a pure string, it is highly recommend to enclose it in double quotes. Variables can be built-in Nginx variables, or user-defined with the SET VARIABLE feature directive. For a list of common Nginx variables see http://wiki.nginx.org/HttpCoreModule#Variables. Note that this list is not a complete list, there are additional Nginx variables not listed on that page. ‘