Add more selective match to increase the regex precedence
This commit is contained in:
15
containers/traefik/files/conf/force_trailing_slash.yml
Normal file
15
containers/traefik/files/conf/force_trailing_slash.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
http:
|
||||
middlewares:
|
||||
force-trailing-slash:
|
||||
chain:
|
||||
middlewares:
|
||||
- add-trailing-slash
|
||||
- strip-after-slash
|
||||
add-trailing-slash:
|
||||
redirectregex:
|
||||
regex: "^(https?://[^/]+/[a-z0-9_]+)$"
|
||||
replacement: "${1}/"
|
||||
permanent: true
|
||||
strip-after-slash:
|
||||
stripprefixregex:
|
||||
regex: "/[a-z0-9_]+"
|
||||
@@ -104,9 +104,8 @@
|
||||
io.containers.autoupdate: "registry"
|
||||
traefik.enable: "true"
|
||||
traefik.http.middlewares.traefik-auth.basicauth.users: "{{ vault_traefik_basic_auth }}"
|
||||
traefik.http.middlewares.traefik-prefixstrip.stripprefix.prefixes: "/traefik"
|
||||
traefik.http.routers.traefik.entrypoints: "https"
|
||||
traefik.http.routers.traefik.rule: "PathPrefix(`/traefik`) || HeadersRegexp(`Referer`, `.*/traefik/.*`)"
|
||||
traefik.http.routers.traefik.rule: "Host(`{{ vault_domain }}`) && PathPrefix(`/api`,`/dashboard`)"
|
||||
traefik.http.routers.traefik.middlewares: "traefik-auth@docker"
|
||||
traefik.http.routers.traefik.tls: "true"
|
||||
traefik.http.routers.traefik.tls.certresolver: "wildcard"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
http:
|
||||
routers:
|
||||
cockpit:
|
||||
rule: "PathPrefix(`/cockpit`)"
|
||||
rule: "Host(`{{ vault_domain }}`) && (PathPrefix(`/cockpit/`) || Path(`/cockpit`))"
|
||||
entryPoints: https
|
||||
middlewares:
|
||||
- cockpit-stripprefix
|
||||
- force-trailing-slash
|
||||
service: cockpit
|
||||
tls:
|
||||
certresolver: wildcard
|
||||
|
||||
Reference in New Issue
Block a user