代码拉取完成,页面将自动刷新
Terminology
section and improve (#6610)
title |
---|
Global Rule |
A Plugin configuration can be bound directly to a Route, a Service or a Consumer. But what if we want a Plugin to work on all requests? This is where we register a global Plugin with Global Rule.
The example below shows how you can use the limit-count
Plugin on all requests:
curl -X PUT \
https://{apisix_listen_address}/apisix/admin/global_rules/1 \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
-d '{
"plugins": {
"limit-count": {
"time_window": 60,
"policy": "local",
"count": 2,
"key": "remote_addr",
"rejected_code": 503
}
}
}'
You can also list all the Global rules by making this request with the Admin API:
curl https://{apisix_listen_address}/apisix/admin/global_rules
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。