Skip to main content

Plugin execution settings

Every plugin carries these settings beside its own, under Execution in the console. They decide whether, when and in what order the plugin runs on the object it is added to.

HTTP plugins​

Conditions and hooks the engine applies to this plugin. Every field is optional.

Enabled_meta.disableboolean

Off keeps the settings but the engine skips the plugin.

off is true in the JSON
Priority_meta.priorityinteger

A number that moves this plugin among the others on this object: higher runs earlier. It orders plugins inside one phase only. A plugin of an earlier phase still runs first: fault-injection answers in the rewrite phase before mocking, which answers in the access phase, even with mocking set to the higher 12000.

Filter_meta.filterarray

Conditions on request variables, such as arg_x == 1. The plugin runs only when all of them hold.

conditions on request variables: see Conditions on request variables
Error response_meta.error_responsestring or object

Custom response the engine sends when this plugin rejects the request: text, or a JSON object.

example {"message":"Refused by the gateway policy"}
Pre-function_meta.pre_functionstring

Lua returning a function(conf, ctx), run before this plugin in each phase the plugin itself runs in. It is not checked when saved: a chunk that returns something else is stored, logs an error on every request, and the plugin still runs.

example return function(conf, ctx) ngx.log(ngx.INFO, "g8 before the plugin") end

Stream plugins​

Conditions and hooks the engine applies to this plugin. Every field is optional.

Enabled_meta.disableboolean

Off keeps the settings but the engine skips the plugin.

off is true in the JSON
Priority_meta.priorityinteger

A number that moves this plugin among the others on this object: higher runs earlier. It orders plugins inside one phase only. A plugin of an earlier phase still runs first: fault-injection answers in the rewrite phase before mocking, which answers in the access phase, even with mocking set to the higher 12000.

Filter_meta.filterarray

Conditions on request variables, such as arg_x == 1. The plugin runs only when all of them hold.

conditions on request variables: see Conditions on request variables
Error response_meta.error_responsestring or object

Custom response the engine sends when this plugin rejects the request: text, or a JSON object.

Pre-function_meta.pre_functionstring

Lua returning a function(conf, ctx), run before this plugin in each phase the plugin itself runs in. It is not checked when saved: a chunk that returns something else is stored, logs an error on every request, and the plugin still runs.

example return function(conf, ctx) ngx.log(ngx.INFO, "g8 before the plugin") end
G8 dev · Apache APISIX® 3.19.0
Apache, Apache APISIX and APISIX are trademarks of The Apache Software Foundation.