From b4dc96527da4b7a730cc22652eb376fb7bb0c839 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Tue, 19 Dec 2017 09:48:03 +0100 Subject: [PATCH] Move rate limit documentation. --- docs/basics.md | 29 ----------------------------- docs/configuration/commons.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/docs/basics.md b/docs/basics.md index 15d3f977b..9a84281a4 100644 --- a/docs/basics.md +++ b/docs/basics.md @@ -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. diff --git a/docs/configuration/commons.md b/docs/configuration/commons.md index 69e167e86..0f97cc355 100644 --- a/docs/configuration/commons.md +++ b/docs/configuration/commons.md @@ -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