Make compress middleware for /.well-known/matrix/* configurable

This commit is contained in:
Slavi Pantaleev
2024-01-03 16:18:39 +02:00
parent e81a395a98
commit 97f40a95fb
2 changed files with 15 additions and 3 deletions

View File

@ -13,11 +13,19 @@ traefik.http.services.{{ matrix_static_files_ident }}.loadbalancer.server.port={
#}
{% if matrix_static_files_container_labels_well_known_matrix_endpoint_enabled %}
{% set well_known_matrix_endpoint_middlewares = [] %}
{% if matrix_static_files_container_labels_well_known_matrix_endpoint_middleware_compress_enabled %}
traefik.http.middlewares.{{ matrix_static_files_ident }}-well-known-endpoint-compress.compress=true
traefik.http.middlewares.{{ matrix_static_files_ident }}-well-known-endpoint-compress.compress.minResponseBodyBytes=100
traefik.http.middlewares.{{ matrix_static_files_ident }}-well-known-endpoint-compress.compress.minResponseBodyBytes={{ matrix_static_files_container_labels_well_known_matrix_endpoint_middleware_compress_minResponseBodyBytes }}
{% set well_known_matrix_endpoint_middlewares = well_known_matrix_endpoint_middlewares + [matrix_static_files_ident + '-well-known-endpoint-compress'] %}
{% endif %}
traefik.http.routers.{{ matrix_static_files_ident }}-well-known-endpoint.rule={{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_rule }}
traefik.http.routers.{{ matrix_static_files_ident }}-well-known-endpoint.middlewares={{ matrix_static_files_ident }}-well-known-endpoint-compress
{% if well_known_matrix_endpoint_middlewares | length > 0 %}
traefik.http.routers.{{ matrix_static_files_ident }}-well-known-endpoint.middlewares={{ well_known_matrix_endpoint_middlewares | join(',') }}
{% endif %}
{% if matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_priority | int > 0 %}
traefik.http.routers.{{ matrix_static_files_ident }}-well-known-endpoint.priority={{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_priority }}