docs: update rate limiting
This commit is contained in:
@@ -10,13 +10,35 @@ nav_order: 6
|
||||
|
||||
The RateLimit middleware ensures that services will receive a fair number of requests, and allows one to define what fair is.
|
||||
|
||||
Example of global rateLimit middleware
|
||||
Example of rate limiting middleware
|
||||
|
||||
```yaml
|
||||
middlewares:
|
||||
- name: rate-limit
|
||||
type: ratelimit #or rateLimit
|
||||
paths:
|
||||
- /*
|
||||
rule:
|
||||
unit: minute # or hour
|
||||
requestsPerUnit: 10
|
||||
```
|
||||
|
||||
Example of route rate limiting middleware
|
||||
|
||||
```yaml
|
||||
version: 0.1.7
|
||||
gateway:
|
||||
routes:
|
||||
- name: Example
|
||||
rateLimit: 60 # peer minute
|
||||
```
|
||||
|
||||
Example of global rate limiting middleware
|
||||
|
||||
```yaml
|
||||
version: 0.1.7
|
||||
gateway:
|
||||
# Proxy rate limit, it's In-Memory IP based
|
||||
rateLimit: 60 # peer minute
|
||||
routes:
|
||||
- name: Example
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user