Skip to content

Commit

Permalink
Add variables for tweaking transport.respondingTimeouts for the web &…
Browse files Browse the repository at this point in the history
… web-secure entrypoints
  • Loading branch information
spantaleev committed Nov 14, 2024
1 parent 368f1b0 commit a008706
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ traefik_config_entrypoint_web_forwardedHeaders_trustedIPs: []
# Controls `forwardedHeaders.insecure` for this entrypoint.
# Also see: `traefik_config_entrypoint_web_forwardedHeaders_trustedIPs`
traefik_config_entrypoint_web_forwardedHeaders_insecure: false
# Controls `transport.respondingTimeouts.readTimeout` for the `web` entrypoint - timeouts for incoming requests to the Traefik instance.
# Setting them has no effect for UDP entryPoints.
# See https://doc.traefik.io/traefik/routing/entrypoints/#respondingtimeouts
traefik_config_entrypoint_web_transport_respondingTimeouts_readTimeout: 60s
# Controls `transport.respondingTimeouts.writeTimeout` for the `web` entrypoint - the maximum duration before timing out writes of the response.
# See https://doc.traefik.io/traefik/routing/entrypoints/#respondingtimeouts
traefik_config_entrypoint_web_transport_respondingTimeouts_writeTimeout: 0s
# Controls `transport.respondingTimeouts.idleTimeout` for the `web` entrypoint - the maximum duration an idle (keep-alive) connection will remain idle before closing itself.
# See https://doc.traefik.io/traefik/routing/entrypoints/#respondingtimeouts
traefik_config_entrypoint_web_transport_respondingTimeouts_idleTimeout: 180s

# Controls whether the web entrypoint should be redirected to web-secure
# If web-secure is enabled, we enable this redirection by default.
Expand All @@ -151,6 +161,16 @@ traefik_config_entrypoint_web_secure_forwardedHeaders_trustedIPs: []
# Controls `forwardedHeaders.insecure` for this entrypoint.
# Also see: `traefik_config_entrypoint_web_secure_forwardedHeaders_trustedIPs`
traefik_config_entrypoint_web_secure_forwardedHeaders_insecure: false
# Controls `transport.respondingTimeouts.readTimeout` for the `web-secure` entrypoint - timeouts for incoming requests to the Traefik instance.
# Setting them has no effect for UDP entryPoints.
# See https://doc.traefik.io/traefik/routing/entrypoints/#respondingtimeouts
traefik_config_entrypoint_web_secure_transport_respondingTimeouts_readTimeout: "{{ traefik_config_entrypoint_web_transport_respondingTimeouts_readTimeout }}"
# Controls `transport.respondingTimeouts.writeTimeout` for the `web-secure` entrypoint - the maximum duration before timing out writes of the response.
# See https://doc.traefik.io/traefik/routing/entrypoints/#respondingtimeouts
traefik_config_entrypoint_web_secure_transport_respondingTimeouts_writeTimeout: "{{ traefik_config_entrypoint_web_transport_respondingTimeouts_writeTimeout }}"
# Controls `transport.respondingTimeouts.idleTimeout` for the `web-secure` entrypoint - the maximum duration an idle (keep-alive) connection will remain idle before closing itself.
# See https://doc.traefik.io/traefik/routing/entrypoints/#respondingtimeouts
traefik_config_entrypoint_web_secure_transport_respondingTimeouts_idleTimeout: "{{ traefik_config_entrypoint_web_transport_respondingTimeouts_idleTimeout }}"

traefik_config_entrypoint_web_secure_http3_enabled: true
traefik_config_entrypoint_web_secure_http3_config_advertisedPort: "{{ traefik_config_entrypoint_web_secure_port }}"
Expand Down
12 changes: 12 additions & 0 deletions templates/traefik.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ entryPoints:
{% endif %}
{% endif %}

transport:
respondingTimeouts:
readTimeout: {{ traefik_config_entrypoint_web_transport_respondingTimeouts_readTimeout | to_json }}
writeTimeout: {{ traefik_config_entrypoint_web_transport_respondingTimeouts_writeTimeout | to_json }}
idleTimeout: {{ traefik_config_entrypoint_web_transport_respondingTimeouts_idleTimeout | to_json }}

{% if traefik_config_entrypoint_web_to_web_secure_redirection_enabled %}
http:
redirections:
Expand Down Expand Up @@ -63,6 +69,12 @@ entryPoints:
insecure: true
{% endif %}
{% endif %}

transport:
respondingTimeouts:
readTimeout: {{ traefik_config_entrypoint_web_secure_transport_respondingTimeouts_readTimeout | to_json }}
writeTimeout: {{ traefik_config_entrypoint_web_secure_transport_respondingTimeouts_writeTimeout | to_json }}
idleTimeout: {{ traefik_config_entrypoint_web_secure_transport_respondingTimeouts_idleTimeout | to_json }}
{% endif %}

{% if traefik_config_entrypoint_metrics_enabled %}
Expand Down

0 comments on commit a008706

Please sign in to comment.