50 lines
2.5 KiB
Plaintext
Raw Normal View History

{% if livekit_server_container_labels_traefik_enabled %}
traefik.enable=true
{% if livekit_server_container_labels_traefik_docker_network %}
traefik.docker.network={{ livekit_server_container_labels_traefik_docker_network }}
{% endif %}
traefik.http.services.{{ livekit_server_identifier }}.loadbalancer.server.port={{ livekit_server_config_port }}
{% set middlewares = [] %}
{% if livekit_server_container_labels_traefik_path_prefix != '/' %}
traefik.http.middlewares.{{ livekit_server_identifier }}-slashless-redirect.redirectregex.regex=({{ livekit_server_container_labels_traefik_path_prefix | quote }})$
traefik.http.middlewares.{{ livekit_server_identifier }}-slashless-redirect.redirectregex.replacement=${1}/
{% set middlewares = middlewares + [livekit_server_identifier + '-server-slashless-redirect'] %}
traefik.http.middlewares.{{ livekit_server_identifier }}-strip-prefix.stripprefix.prefixes={{ livekit_server_container_labels_traefik_path_prefix }}
{% set middlewares = middlewares + [livekit_server_identifier + '-strip-prefix'] %}
{% endif %}
{% if livekit_server_container_labels_traefik_additional_response_headers.keys() | length > 0 %}
{% for name, value in livekit_server_container_labels_traefik_additional_response_headers.items() %}
traefik.http.middlewares.{{ livekit_server_identifier }}-add-headers.headers.customresponseheaders.{{ name }}={{ value }}
2024-10-01 17:04:11 +10:00
{% endfor %}
{% set middlewares = middlewares + [livekit_server_identifier + '-add-headers'] %}
2024-10-01 17:04:11 +10:00
{% endif %}
traefik.http.routers.{{ livekit_server_identifier }}.rule={{ livekit_server_container_labels_traefik_rule }}
{% if livekit_server_container_labels_traefik_priority | int > 0 %}
traefik.http.routers.{{ livekit_server_identifier }}.priority={{ livekit_server_container_labels_traefik_priority }}
{% endif %}
traefik.http.routers.{{ livekit_server_identifier }}.service={{ livekit_server_identifier }}
{% if middlewares | length > 0 %}
traefik.http.routers.{{ livekit_server_identifier }}.middlewares={{ middlewares | join(',') }}
{% endif %}
traefik.http.routers.{{ livekit_server_identifier }}.entrypoints={{ livekit_server_container_labels_traefik_entrypoints }}
traefik.http.routers.{{ livekit_server_identifier }}.tls={{ livekit_server_container_labels_traefik_tls | to_json }}
{% if livekit_server_container_labels_traefik_tls %}
traefik.http.routers.{{ livekit_server_identifier }}.tls.certResolver={{ livekit_server_container_labels_traefik_tls_certResolver }}
{% endif %}
{% endif %}
{{ livekit_server_container_labels_additional_labels }}