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.
_meta.disablebooleanOff keeps the settings but the engine skips the plugin.
true in the JSON_meta.priorityintegerA 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.
_meta.filterarrayConditions on request variables, such as arg_x == 1. The plugin runs only when all of them hold.
_meta.error_responsestring or objectCustom response the engine sends when this plugin rejects the request: text, or a JSON object.
{"message":"Refused by the gateway policy"}_meta.pre_functionstringLua 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.
return function(conf, ctx)
ngx.log(ngx.INFO, "g8 before the plugin")
endStream plugins
Conditions and hooks the engine applies to this plugin. Every field is optional.
_meta.disablebooleanOff keeps the settings but the engine skips the plugin.
true in the JSON_meta.priorityintegerA 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.
_meta.filterarrayConditions on request variables, such as arg_x == 1. The plugin runs only when all of them hold.
_meta.error_responsestring or objectCustom response the engine sends when this plugin rejects the request: text, or a JSON object.
_meta.pre_functionstringLua 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.
return function(conf, ctx)
ngx.log(ngx.INFO, "g8 before the plugin")
end