Certain MaxCDN Edge Rules allow for variables to be set within a rule so that they can dynamically act on a varying range of requests without each condition needing to be hard-coded into the rule. We refer to these as Conditionals.
This article seeks to clarify and explain the different types of Conditionals that can be defined.
The EdgeRules feature is available only on Enterprise plans.
Key Conditional
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.
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.
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.
Relational Operator Conditional
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.
Value Conditional
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.
We hope this article was helpful and as always, If you have any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support - we are available 24/7 by chat or email!