docs: update rate limiting
This commit is contained in:
@@ -10,12 +10,34 @@ 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
|
||||
|
||||
@@ -42,7 +42,7 @@ type Route struct {
|
||||
HealthCheck RouteHealthCheck `yaml:"healthCheck"`
|
||||
// Cors contains the route cors headers
|
||||
Cors Cors `yaml:"cors"`
|
||||
RateLimit int `yaml:"rateLimit"`
|
||||
RateLimit int `yaml:"rateLimit,omitempty"`
|
||||
// DisableHostFording Disable X-forwarded header.
|
||||
//
|
||||
// [X-Forwarded-Host, X-Forwarded-For, Host, Scheme ]
|
||||
|
||||
Reference in New Issue
Block a user