{% if matrix_livekit_server_container_labels_traefik_enabled %} traefik.enable=true # Network configuration for Traefik {% if matrix_livekit_server_container_labels_traefik_docker_network %} traefik.docker.network={{ matrix_livekit_server_container_labels_traefik_docker_network }} {% endif %} traefik.http.services.matrix-livekit-server.loadbalancer.server.port=7880 {% set middlewares = [] %} # Path prefix handling for Livekit {% if matrix_livekit_server_container_labels_traefik_path_prefix != '/' %} traefik.http.middlewares.matrix-livekit-server-slashless-redirect.redirectregex.regex=({{ matrix_livekit_server_container_labels_traefik_path_prefix | quote }})$ traefik.http.middlewares.matrix-livekit-server-slashless-redirect.redirectregex.replacement=${1}/ {% set middlewares = middlewares + ['matrix-livekit-server-slashless-redirect'] %} traefik.http.middlewares.matrix-livekit-server-strip-prefix.stripprefix.prefixes={{ matrix_livekit_server_container_labels_traefik_path_prefix }} {% set middlewares = middlewares + ['matrix-livekit-server-strip-prefix'] %} {% endif %} {% if matrix_livekit_server_container_labels_traefik_additional_response_headers.keys() | length > 0 %} {% for name, value in matrix_livekit_server_container_labels_traefik_additional_response_headers.items() %} traefik.http.middlewares.matrix-livekit-server-add-headers.headers.customresponseheaders.{{ name }}={{ value }} {% endfor %} {% set middlewares = middlewares + ['matrix-livekit-server-add-headers'] %} {% endif %} traefik.http.routers.matrix-livekit-server.rule={{ matrix_livekit_server_container_labels_traefik_rule }} {% if matrix_livekit_server_container_labels_traefik_priority | int > 0 %} traefik.http.routers.matrix-livekit-server.priority={{ matrix_livekit_server_container_labels_traefik_priority }} {% endif %} traefik.http.routers.matrix-livekit-server.service=matrix-livekit-server {% if middlewares | length > 0 %} traefik.http.routers.matrix-livekit-server.middlewares={{ middlewares | join(',') }} {% endif %} traefik.http.routers.matrix-livekit-server.entrypoints={{ matrix_livekit_server_container_labels_traefik_entrypoints }} traefik.http.routers.matrix-livekit-server.tls={{ matrix_livekit_server_container_labels_traefik_tls | to_json }} {% if matrix_livekit_server_container_labels_traefik_tls %} traefik.http.routers.matrix-livekit-server.tls.certResolver={{ matrix_livekit_server_container_labels_traefik_tls_certResolver }} {% endif %} {% endif %} {{ matrix_livekit_server_container_labels_additional_labels }}