Add a response forwarding section to the service documentation

This commit is contained in:
Jean-Baptiste Doumenjou 2019-10-01 13:26:04 +02:00 committed by Traefiker Bot
parent 0082fe8173
commit 6f63e24dbb
4 changed files with 37 additions and 8 deletions

View file

@ -333,9 +333,8 @@ you'd add the label `traefik.http.services.<name-of-your-choice>.loadbalancer.pa
``` ```
??? info "`traefik.http.services.<service_name>.loadbalancer.responseforwarding.flushinterval`" ??? info "`traefik.http.services.<service_name>.loadbalancer.responseforwarding.flushinterval`"
<!-- TODO doc responseforwarding in services page -->
FlushInterval specifies the flush interval to flush to the client while copying the response body. See [response forwarding](../services/index.md#response-forwarding) for more information.
```yaml ```yaml
- "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10" - "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10"

View file

@ -253,10 +253,9 @@ For example, to change the passHostHeader behavior, you'd add the label `"traefi
``` ```
??? info "`traefik.http.services.<service_name>.loadbalancer.responseforwarding.flushinterval`" ??? info "`traefik.http.services.<service_name>.loadbalancer.responseforwarding.flushinterval`"
<!-- TODO doc responseforwarding in services page -->
FlushInterval specifies the flush interval to flush to the client while copying the response body.
See [response forwarding](../services/index.md#response-forwarding) for more information.
```json ```json
"traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval": "10" "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval": "10"
``` ```

View file

@ -259,10 +259,9 @@ you'd add the label `traefik.http.services.{name-of-your-choice}.loadbalancer.pa
``` ```
??? info "`traefik.http.services.<service_name>.loadbalancer.responseforwarding.flushinterval`" ??? info "`traefik.http.services.<service_name>.loadbalancer.responseforwarding.flushinterval`"
<!-- TODO doc responseforwarding in services page -->
FlushInterval specifies the flush interval to flush to the client while copying the response body.
See [response forwarding](../services/index.md#response-forwarding) for more information.
```yaml ```yaml
- "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10" - "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10"
``` ```

View file

@ -346,7 +346,39 @@ By default, `passHostHeader` is true.
loadBalancer: loadBalancer:
passHostHeader: false passHostHeader: false
``` ```
#### Response Forwarding
This section is about configuring how Traefik forwards the response from the backend server to the client.
Below are the available options for the Response Forwarding mechanism:
- `FlushInterval` specifies the interval in between flushes to the client while copying the response body.
It is a duration in milliseconds, defaulting to 100.
A negative value means to flush immediately after each write to the client.
The FlushInterval is ignored when ReverseProxy recognizes a response as a streaming response;
for such responses, writes are flushed to the client immediately.
??? example "Using a custom FlushInterval -- Using the [File Provider](../../providers/file.md)"
```toml tab="TOML"
## Dynamic configuration
[http.services]
[http.services.Service-1]
[http.services.Service-1.loadBalancer.responseForwarding]
flushInterval = "1s"
```
```yaml tab="YAML"
## Dynamic configuration
http:
services:
Service-1:
loadBalancer:
responseForwarding:
flushInterval: 1s
```
### Weighted Round Robin (service) ### Weighted Round Robin (service)
The WRR is able to load balance the requests between multiple services based on weights. The WRR is able to load balance the requests between multiple services based on weights.