diff --git a/integration/testdata/rawdata-ingress.json b/integration/testdata/rawdata-ingress.json index b70c3b552..45518f455 100644 --- a/integration/testdata/rawdata-ingress.json +++ b/integration/testdata/rawdata-ingress.json @@ -60,7 +60,7 @@ "middlewares": { "dashboard_redirect@internal": { "redirectRegex": { - "regex": "^(http:\\/\\/[^:]+(:\\d+)?)/$", + "regex": "^(http:\\/\\/[^:\\/]+(:\\d+)?)\\/$", "replacement": "${1}/dashboard/", "permanent": true }, diff --git a/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json b/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json index 60f72a7f7..e4a1e2ee4 100644 --- a/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json +++ b/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json @@ -25,7 +25,7 @@ "middlewares": { "dashboard_redirect": { "redirectRegex": { - "regex": "^(http:\\/\\/[^:]+(:\\d+)?)/$", + "regex": "^(http:\\/\\/[^:\\/]+(:\\d+)?)\\/$", "replacement": "${1}/dashboard/", "permanent": true } diff --git a/pkg/provider/traefik/fixtures/full_configuration.json b/pkg/provider/traefik/fixtures/full_configuration.json index e8c3a9ec6..f4852fcb5 100644 --- a/pkg/provider/traefik/fixtures/full_configuration.json +++ b/pkg/provider/traefik/fixtures/full_configuration.json @@ -57,7 +57,7 @@ "middlewares": { "dashboard_redirect": { "redirectRegex": { - "regex": "^(http:\\/\\/[^:]+(:\\d+)?)/$", + "regex": "^(http:\\/\\/[^:\\/]+(:\\d+)?)\\/$", "replacement": "${1}/dashboard/", "permanent": true } diff --git a/pkg/provider/traefik/internal.go b/pkg/provider/traefik/internal.go index 1501b29a0..091d2b13f 100644 --- a/pkg/provider/traefik/internal.go +++ b/pkg/provider/traefik/internal.go @@ -86,7 +86,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) { cfg.HTTP.Middlewares["dashboard_redirect"] = &dynamic.Middleware{ RedirectRegex: &dynamic.RedirectRegex{ - Regex: `^(http:\/\/[^:]+(:\d+)?)/$`, + Regex: `^(http:\/\/[^:\/]+(:\d+)?)\/$`, Replacement: "${1}/dashboard/", Permanent: true, },