Move rate limit documentation.
This commit is contained in:
parent
35b5ca4c63
commit
b4dc96527d
2 changed files with 30 additions and 29 deletions
|
@ -321,35 +321,6 @@ In this example, traffic routed through the first frontend will have the `X-Fram
|
||||||
!!! note
|
!!! note
|
||||||
The detailed documentation for those security headers can be found in [unrolled/secure](https://github.com/unrolled/secure#available-options).
|
The detailed documentation for those security headers can be found in [unrolled/secure](https://github.com/unrolled/secure#available-options).
|
||||||
|
|
||||||
#### Rate limiting
|
|
||||||
|
|
||||||
Rate limiting can be configured per frontend.
|
|
||||||
Multiple sets of rates can be added to each frontend, but the time periods must be unique.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[frontends]
|
|
||||||
[frontends.frontend1]
|
|
||||||
passHostHeader = true
|
|
||||||
entrypoints = ["http"]
|
|
||||||
backend = "backend1"
|
|
||||||
[frontends.frontend1.routes.test_1]
|
|
||||||
rule = "Path:/"
|
|
||||||
[frontends.frontend1.ratelimit]
|
|
||||||
extractorfunc = "client.ip"
|
|
||||||
[frontends.frontend1.ratelimit.rateset.rateset1]
|
|
||||||
period = "10s"
|
|
||||||
average = 100
|
|
||||||
burst = 200
|
|
||||||
[frontends.frontend1.ratelimit.rateset.rateset2]
|
|
||||||
period = "3s"
|
|
||||||
average = 5
|
|
||||||
burst = 10
|
|
||||||
```
|
|
||||||
|
|
||||||
In the above example, frontend1 is configured to limit requests by the client's ip address.
|
|
||||||
An average of 5 requests every 3 seconds is allowed and an average of 100 requests every 10 seconds.
|
|
||||||
These can "burst" up to 10 and 200 in each period respectively.
|
|
||||||
|
|
||||||
### Backends
|
### Backends
|
||||||
|
|
||||||
A backend is responsible to load-balance the traffic coming from one or more frontends to a set of http servers.
|
A backend is responsible to load-balance the traffic coming from one or more frontends to a set of http servers.
|
||||||
|
|
|
@ -277,6 +277,36 @@ Custom error pages are easiest to implement using the file provider.
|
||||||
For dynamic providers, the corresponding template file needs to be customized accordingly and referenced in the Traefik configuration.
|
For dynamic providers, the corresponding template file needs to be customized accordingly and referenced in the Traefik configuration.
|
||||||
|
|
||||||
|
|
||||||
|
## Rate limiting
|
||||||
|
|
||||||
|
Rate limiting can be configured per frontend.
|
||||||
|
Multiple sets of rates can be added to each frontend, but the time periods must be unique.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[frontends]
|
||||||
|
[frontends.frontend1]
|
||||||
|
passHostHeader = true
|
||||||
|
entrypoints = ["http"]
|
||||||
|
backend = "backend1"
|
||||||
|
[frontends.frontend1.routes.test_1]
|
||||||
|
rule = "Path:/"
|
||||||
|
[frontends.frontend1.ratelimit]
|
||||||
|
extractorfunc = "client.ip"
|
||||||
|
[frontends.frontend1.ratelimit.rateset.rateset1]
|
||||||
|
period = "10s"
|
||||||
|
average = 100
|
||||||
|
burst = 200
|
||||||
|
[frontends.frontend1.ratelimit.rateset.rateset2]
|
||||||
|
period = "3s"
|
||||||
|
average = 5
|
||||||
|
burst = 10
|
||||||
|
```
|
||||||
|
|
||||||
|
In the above example, frontend1 is configured to limit requests by the client's ip address.
|
||||||
|
An average of 5 requests every 3 seconds is allowed and an average of 100 requests every 10 seconds.
|
||||||
|
These can "burst" up to 10 and 200 in each period respectively.
|
||||||
|
|
||||||
|
|
||||||
## Retry Configuration
|
## Retry Configuration
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
|
|
Loading…
Reference in a new issue