Add KeepAliveMaxTime and KeepAliveMaxRequests features to entrypoints
This commit is contained in:
parent
3dfaa3d5fa
commit
9662cdca64
9 changed files with 258 additions and 7 deletions
|
@ -171,6 +171,12 @@ Trust all. (Default: ```false```)
|
|||
`--entrypoints.<name>.proxyprotocol.trustedips`:
|
||||
Trust only selected IPs.
|
||||
|
||||
`--entrypoints.<name>.transport.keepalivemaxrequests`:
|
||||
Maximum number of requests before closing a keep-alive connection. (Default: ```0```)
|
||||
|
||||
`--entrypoints.<name>.transport.keepalivemaxtime`:
|
||||
Maximum duration before closing a keep-alive connection. (Default: ```0```)
|
||||
|
||||
`--entrypoints.<name>.transport.lifecycle.gracetimeout`:
|
||||
Duration to give active requests a chance to finish before Traefik stops. (Default: ```10```)
|
||||
|
||||
|
|
|
@ -171,6 +171,12 @@ Trust all. (Default: ```false```)
|
|||
`TRAEFIK_ENTRYPOINTS_<NAME>_PROXYPROTOCOL_TRUSTEDIPS`:
|
||||
Trust only selected IPs.
|
||||
|
||||
`TRAEFIK_ENTRYPOINTS_<NAME>_TRANSPORT_KEEPALIVEMAXREQUESTS`:
|
||||
Maximum number of requests before closing a keep-alive connection. (Default: ```0```)
|
||||
|
||||
`TRAEFIK_ENTRYPOINTS_<NAME>_TRANSPORT_KEEPALIVEMAXTIME`:
|
||||
Maximum duration before closing a keep-alive connection. (Default: ```0```)
|
||||
|
||||
`TRAEFIK_ENTRYPOINTS_<NAME>_TRANSPORT_LIFECYCLE_GRACETIMEOUT`:
|
||||
Duration to give active requests a chance to finish before Traefik stops. (Default: ```10```)
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
[entryPoints.EntryPoint0]
|
||||
address = "foobar"
|
||||
[entryPoints.EntryPoint0.transport]
|
||||
keepAliveMaxRequests = 42
|
||||
keepAliveMaxTime = "42s"
|
||||
[entryPoints.EntryPoint0.transport.lifeCycle]
|
||||
requestAcceptGraceTimeout = "42s"
|
||||
graceTimeOut = "42s"
|
||||
|
|
|
@ -15,6 +15,8 @@ entryPoints:
|
|||
EntryPoint0:
|
||||
address: foobar
|
||||
transport:
|
||||
keepAliveMaxRequests: 42
|
||||
keepAliveMaxTime: 42s
|
||||
lifeCycle:
|
||||
requestAcceptGraceTimeout: 42s
|
||||
graceTimeOut: 42s
|
||||
|
|
|
@ -589,17 +589,77 @@ Controls the behavior of Traefik during the shutdown phase.
|
|||
--entryPoints.name.transport.lifeCycle.graceTimeOut=42
|
||||
```
|
||||
|
||||
#### `keepAliveMaxRequests`
|
||||
|
||||
_Optional, Default=0_
|
||||
|
||||
The maximum number of requests Traefik can handle before sending a `Connection: Close` header to the client (for HTTP2, Traefik sends a GOAWAY). Zero means no limit.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
## Static configuration
|
||||
entryPoints:
|
||||
name:
|
||||
address: ":8888"
|
||||
transport:
|
||||
keepAliveMaxRequests: 42
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
## Static configuration
|
||||
[entryPoints]
|
||||
[entryPoints.name]
|
||||
address = ":8888"
|
||||
[entryPoints.name.transport]
|
||||
keepAliveMaxRequests = 42
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
## Static configuration
|
||||
--entryPoints.name.address=:8888
|
||||
--entryPoints.name.transport.keepAliveRequests=42
|
||||
```
|
||||
|
||||
#### `keepAliveMaxTime`
|
||||
|
||||
_Optional, Default=0s_
|
||||
|
||||
The maximum duration Traefik can handle requests before sending a `Connection: Close` header to the client (for HTTP2, Traefik sends a GOAWAY). Zero means no limit.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
## Static configuration
|
||||
entryPoints:
|
||||
name:
|
||||
address: ":8888"
|
||||
transport:
|
||||
keepAliveMaxTime: 42s
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
## Static configuration
|
||||
[entryPoints]
|
||||
[entryPoints.name]
|
||||
address = ":8888"
|
||||
[entryPoints.name.transport]
|
||||
keepAliveMaxTime = 42s
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
## Static configuration
|
||||
--entryPoints.name.address=:8888
|
||||
--entryPoints.name.transport.keepAliveTime=42s
|
||||
```
|
||||
|
||||
### ProxyProtocol
|
||||
|
||||
Traefik supports [ProxyProtocol](https://www.haproxy.org/download/2.0/doc/proxy-protocol.txt) version 1 and 2.
|
||||
Traefik supports [PROXY protocol](https://www.haproxy.org/download/2.0/doc/proxy-protocol.txt) version 1 and 2.
|
||||
|
||||
If Proxy Protocol header parsing is enabled for the entry point, this entry point can accept connections with or without Proxy Protocol headers.
|
||||
If PROXY protocol header parsing is enabled for the entry point, this entry point can accept connections with or without PROXY protocol headers.
|
||||
|
||||
If the Proxy Protocol header is passed, then the version is determined automatically.
|
||||
If the PROXY protocol header is passed, then the version is determined automatically.
|
||||
|
||||
??? info "`proxyProtocol.trustedIPs`"
|
||||
|
||||
Enabling Proxy Protocol with Trusted IPs.
|
||||
Enabling PROXY protocol with Trusted IPs.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
## Static configuration
|
||||
|
@ -662,7 +722,7 @@ If the Proxy Protocol header is passed, then the version is determined automatic
|
|||
|
||||
!!! warning "Queuing Traefik behind Another Load Balancer"
|
||||
|
||||
When queuing Traefik behind another load-balancer, make sure to configure Proxy Protocol on both sides.
|
||||
When queuing Traefik behind another load-balancer, make sure to configure PROXY protocol on both sides.
|
||||
Not doing so could introduce a security risk in your system (enabling request forgery).
|
||||
|
||||
## HTTP Options
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue