Rename the path middleware so it's added later (after auth)

This commit is contained in:
Daniel Berteaud 2024-02-19 10:17:13 +01:00
parent 1ee95c47a1
commit 89d47a023a
2 changed files with 4 additions and 4 deletions

View File

@ -78,9 +78,9 @@ job "traefik" {
"traefik.enable=true",
"traefik.http.routers.traefik-api.entrypoints=https",
"traefik.http.middlewares.csp-traefik-api.headers.contentsecuritypolicy=default-src 'self';font-src 'self' data:;img-src 'self' data:;script-src 'self' 'unsafe-inline' 'unsafe-eval';style-src 'self' 'unsafe-inline';",
"traefik.http.middlewares.traefik-api-path.replacepathregex.regex=^/dashboard/(.*)",
"traefik.http.middlewares.traefik-api-path.replacepathregex.replacement=/dashboard/$${1}",
"traefik.http.routers.traefik-api.middlewares=security-headers@file,rate-limit-std@file,forward-proto@file,traefik-api-path,inflight-std@file,hsts@file,compression@file,csp-traefik-api",
"traefik.http.middlewares.traefik-api-99-path.replacepathregex.regex=^/dashboard/(.*)",
"traefik.http.middlewares.traefik-api-99-path.replacepathregex.replacement=/dashboard/$${1}",
"traefik.http.routers.traefik-api.middlewares=security-headers@file,rate-limit-std@file,forward-proto@file,inflight-std@file,hsts@file,compression@file,traefik-api-99-path,csp-traefik-api",
"traefik.http.routers.traefik-ping.rule=(Host(`traefik.example.org`) || HostRegexp(`(.+\\.)?traefik.service.consul`)) && Path(`/ping`) && Method(`GET`)",
"traefik.http.routers.traefik-ping.service=ping@internal",

View File

@ -31,7 +31,7 @@ traefik:
entrypoints:
- https
middlewares:
path:
99-path:
- replacepathregex.regex=^[[ (.traefik.public_url | urlParse).Path |regexp.Replace "/$" "" ]]/(.*)
- replacepathregex.replacement=/dashboard/$${1}