{% if forgejo_container_labels_traefik_enabled %} traefik.enable=true {% if forgejo_container_labels_traefik_docker_network %} traefik.docker.network={{ forgejo_container_labels_traefik_docker_network }} {% endif %} {% set middlewares = [] %} {% if forgejo_container_labels_traefik_path_prefix != '/' %} traefik.http.middlewares.{{ forgejo_identifier }}-slashless-redirect.redirectregex.regex=^({{ forgejo_container_labels_traefik_path_prefix | quote }})$ traefik.http.middlewares.{{ forgejo_identifier }}-slashless-redirect.redirectregex.replacement=${1}/ {% set middlewares = middlewares + [forgejo_identifier + '-slashless-redirect'] %} {% endif %} {% if forgejo_container_labels_traefik_path_prefix != '/' %} traefik.http.middlewares.{{ forgejo_identifier }}-strip-prefix.stripprefix.prefixes={{ forgejo_container_labels_traefik_path_prefix }} {% set middlewares = middlewares + [forgejo_identifier + '-strip-prefix'] %} {% endif %} {% if forgejo_container_labels_traefik_additional_request_headers.keys() | length > 0 %} {% for name, value in forgejo_container_labels_traefik_additional_request_headers.items() %} traefik.http.middlewares.{{ forgejo_identifier }}-add-request-headers.headers.customrequestheaders.{{ name }}={{ value }} {% endfor %} {% set middlewares = middlewares + [forgejo_identifier + '-add-request-headers'] %} {% endif %} {% if forgejo_container_labels_traefik_additional_response_headers.keys() | length > 0 %} {% for name, value in forgejo_container_labels_traefik_additional_response_headers.items() %} traefik.http.middlewares.{{ forgejo_identifier }}-add-response-headers.headers.customresponseheaders.{{ name }}={{ value }} {% endfor %} {% set middlewares = middlewares + [forgejo_identifier + '-add-response-headers'] %} {% endif %} traefik.http.routers.{{ forgejo_identifier }}.rule={{ forgejo_container_labels_traefik_rule }} {% if forgejo_container_labels_traefik_priority | int > 0 %} traefik.http.routers.{{ forgejo_identifier }}.priority={{ forgejo_container_labels_traefik_priority }} {% endif %} traefik.http.routers.{{ forgejo_identifier }}.service={{ forgejo_identifier }} {% if middlewares | length > 0 %} traefik.http.routers.{{ forgejo_identifier }}.middlewares={{ middlewares | join(',') }} {% endif %} traefik.http.routers.{{ forgejo_identifier }}.entrypoints={{ forgejo_container_labels_traefik_entrypoints }} traefik.http.routers.{{ forgejo_identifier }}.tls={{ forgejo_container_labels_traefik_tls | to_json }} {% if forgejo_container_labels_traefik_tls %} traefik.http.routers.{{ forgejo_identifier }}.tls.certResolver={{ forgejo_container_labels_traefik_tls_certResolver }} {% endif %} traefik.http.services.{{ forgejo_identifier }}.loadbalancer.server.port=3000 {% endif %} {{ forgejo_container_labels_additional_labels }}