Move the rule to variables.yml

This commit is contained in:
Daniel Berteaud 2024-01-29 11:35:30 +01:00
parent bfcc7ead9d
commit bcd825b82c
3 changed files with 4 additions and 4 deletions

View File

@ -22,8 +22,6 @@ job "[[ .instance ]]" {
[[ template "common/connect" $c ]]
tags = [
# Note : add a fake host in the rule to prevent warnings in Traefik logs
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].rule=Host(`fake-acme-host`) || PathPrefix(`/.well-known/acme-challenge/`)",
[[ template "common/traefik_tags" $c ]]
]
}

View File

@ -45,12 +45,11 @@ job "acme-to-vault" {
tags = [
# Note : add a fake host in the rule to prevent warnings in Traefik logs
"traefik.http.routers.acme-to-vault.rule=Host(`fake-acme-host`) || PathPrefix(`/.well-known/acme-challenge/`)",
"traefik.enable=true",
"traefik.http.routers.acme-to-vault.entrypoints=http,https",
"traefik.http.routers.acme-to-vault.priority=2000",
"traefik.http.routers.acme-to-vault.rule=Host(`fake-acme-host`) || PathPrefix(`/.well-known/acme-challenge/`)",
"traefik.http.routers.acme-to-vault.middlewares=rate-limit-std@file,inflight-std@file,hsts@file",
]

View File

@ -29,6 +29,9 @@ acme:
LEGO_DISABLE_CNAME_SUPPORT: true
traefik:
# We use a fakse host rule (which will never match) so Traefik wont complain about a rule with no Host
rule: Host(`fake-acme-host`) || PathPrefix(`/.well-known/acme-challenge/`)
# List of entrypoints where the http-01 challenges will be exposed
entrypoints:
- http