-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
docs: improve limit-req
plugin docs
#11873
base: master
Are you sure you want to change the base?
Conversation
``` | ||
|
||
For authenticated requests: | ||
Create `key-auth` Credential for the consumer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create `key-auth` Credential for the consumer: | |
Create `key-auth` Credential for the Consumer: |
``` | ||
|
||
You can set a custom rejected message by configuring the `rejected_msg` attribute. You will then receive a response like: | ||
Create `key-auth` Credential for the consumer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create `key-auth` Credential for the consumer: | |
Create `key-auth` Credential for the Consumer: |
``` | ||
|
||
Similarly for removing the Plugin from a Consumer: | ||
Send two requests simultaneously, each for one consumer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send two requests simultaneously, each for one consumer: | |
Send two requests simultaneously, each for one Consumer: |
``` | ||
|
||
You should receive `HTTP/1.1 200 OK` for both requests, indicating the request has not exceeded the threshold for each consumer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should receive `HTTP/1.1 200 OK` for both requests, indicating the request has not exceeded the threshold for each consumer. | |
You should receive `HTTP/1.1 200 OK` for both requests, indicating the request has not exceeded the threshold for each Consumer. |
## Delete Plugin | ||
|
||
To remove the `limit-req` Plugin, you can delete the corresponding JSON configuration from the Plugin configuration. APISIX will automatically reload and you do not have to restart for this to take effect. | ||
Create a Route with `key-auth` and `limit-req` plugins, and specify in the `limit-req` Plugin to use a combination of variables as the rate limiting key: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a Route with `key-auth` and `limit-req` plugins, and specify in the `limit-req` Plugin to use a combination of variables as the rate limiting key: | |
Create a Route with `key-auth` and `limit-req` Plugins, and specify in the `limit-req` Plugin to use a combination of variables as the rate-limiting key: |
You can also configure the Plugin on specific consumers to limit their requests. | ||
|
||
First, you can create a Consumer and enable the `limit-req` Plugin on it: | ||
Generate three requests to the route: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate three requests to the route: | |
Generate three requests to the Route: |
Description
Improve
limit-req
plugin docs.Checklist