diff --git a/_traefik3_paths_labels.yml.jinja b/_traefik3_paths_labels.yml.jinja index 67a843cb..d06e873d 100644 --- a/_traefik3_paths_labels.yml.jinja +++ b/_traefik3_paths_labels.yml.jinja @@ -233,9 +233,14 @@ {%- endfor %} {%- endif %} - {#- Apply rule to the first element in domain_groups_list #} - {%- set first_domain_group = domain_groups_list[0] %} - traefik.tcp.routers.{{ key }}-database.rule: {{ domains_rule_sni(first_domain_group) }} + {%- set all_hosts = [] %} + {%- set ns = namespace(all_hosts=[]) %} + {%- for domain_group in domain_groups_list %} + {%- set ns.all_hosts = ns.all_hosts + domain_group.hosts %} + {%- endfor %} + + traefik.tcp.routers.{{ key }}-database.rule: {{ domains_rule_sni(all_hosts) }} + {#- Remember basic middlewares for this domain group #} {%- set _ns = namespace(basic_middlewares=[]) -%} {%- if cidr_whitelist %}