Skip to main content

Conditions on request variables

A plugin's Filter, a route's Conditions and the rules of several plugins are written the same way: as conditions on request variables.

How a condition is written​

A condition is a list of three: a request variable, an operator and a value, such as ["arg_x", "==", "1"]. The console draws the three as columns and adds Negate; in the JSON, Negate is a ! written before the operator.

Variables: uri, host, remote_addr, http_<header>, arg_<query>, cookie_<name>, post_arg_<name>. Negate turns a rule into its opposite.

Operators​

==, ~=, >, >=, <, <=, ~~, ~*, in, has and ipmatch. in and ipmatch take a list as the value.

Groups of conditions​

Where a field takes lists of conditions, each list is a group. A request matches when every condition of at least one group matches.

G8 dev · Apache APISIX® 3.19.0
Apache, Apache APISIX and APISIX are trademarks of The Apache Software Foundation.