Skip to content

Commit

Permalink
Move rate limit documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored and traefiker committed Dec 19, 2017
1 parent 35b5ca4 commit b4dc965
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
29 changes: 0 additions & 29 deletions docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,35 +321,6 @@ In this example, traffic routed through the first frontend will have the `X-Fram
!!! note
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

A backend is responsible to load-balance the traffic coming from one or more frontends to a set of http servers.
Expand Down
30 changes: 30 additions & 0 deletions docs/configuration/commons.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


## 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

```toml
Expand Down

0 comments on commit b4dc965

Please sign in to comment.