1
1
{% if changedetection_container_labels_traefik_enabled %}
2
+ traefik.enable=true
3
+
2
4
{% if changedetection_container_labels_traefik_docker_network %}
3
5
traefik.docker.network={{ changedetection_container_labels_traefik_docker_network }}
4
6
{% endif %}
5
7
6
8
{% set middlewares = [] %}
7
9
10
+ {% if changedetection_container_labels_traefik_path_prefix != '/' %}
11
+ traefik.http.middlewares.{{ changedetection_identifier }}-slashless-redirect.redirectregex.regex=^({{ changedetection_container_labels_traefik_path_prefix | quote }})$
12
+ traefik.http.middlewares.{{ changedetection_identifier }}-slashless-redirect.redirectregex.replacement=${1}/
13
+ {% set middlewares = middlewares + [changedetection_identifier + '-slashless-redirect' ] %}
14
+ {% endif %}
15
+
16
+ {% if changedetection_container_labels_traefik_path_prefix != '/' %}
17
+ traefik.http.middlewares.{{ changedetection_identifier }}-strip-prefix.stripprefix.prefixes={{ changedetection_container_labels_traefik_path_prefix }}
18
+ {% set middlewares = middlewares + [changedetection_identifier + '-strip-prefix' ] %}
19
+ {% endif %}
20
+
8
21
{% if changedetection_container_labels_traefik_additional_request_headers .keys () | length > 0 %}
9
22
{% for name , value in changedetection_container_labels_traefik_additional_request_headers .items () %}
10
23
traefik.http.middlewares.{{ changedetection_identifier }}-add-request-headers.headers.customrequestheaders.{{ name }}={{ value }}
@@ -19,21 +32,21 @@ traefik.http.middlewares.{{ changedetection_identifier }}-add-response-headers.h
19
32
{% set middlewares = middlewares + [changedetection_identifier + '-add-response-headers' ] %}
20
33
{% endif %}
21
34
22
- traefik.enable=true
23
- {% endif %}
24
35
traefik.http.routers.{{ changedetection_identifier }}.rule={{ changedetection_container_labels_traefik_rule }}
25
36
{% if changedetection_container_labels_traefik_priority | int > 0 %}
26
37
traefik.http.routers.{{ changedetection_identifier }}.priority={{ changedetection_container_labels_traefik_priority }}
27
38
{% endif %}
39
+ traefik.http.routers.{{ changedetection_identifier }}.service={{ changedetection_identifier }}
28
40
{% if middlewares | length > 0 %}
29
41
traefik.http.routers.{{ changedetection_identifier }}.middlewares={{ middlewares | join(',') }}
30
42
{% endif %}
31
- traefik.http.routers.{{ changedetection_identifier }}.service={{ changedetection_identifier }}
32
43
traefik.http.routers.{{ changedetection_identifier }}.entrypoints={{ changedetection_container_labels_traefik_entrypoints }}
33
44
traefik.http.routers.{{ changedetection_identifier }}.tls={{ changedetection_container_labels_traefik_tls | to_json }}
34
45
{% if changedetection_container_labels_traefik_tls %}
35
46
traefik.http.routers.{{ changedetection_identifier }}.tls.certResolver={{ changedetection_container_labels_traefik_tls_certResolver }}
36
47
{% endif %}
48
+
37
49
traefik.http.services.{{ changedetection_identifier }}.loadbalancer.server.port={{ changedetection_container_http_port }}
50
+ {% endif %}
38
51
39
- {{ changedetection_container_labels_additional_labels }}
52
+ {{ changedetection_container_labels_additional_labels }}
0 commit comments