Repository: traefik/traefik (language: go)

Issue:
Entrypoint redirections not working with defaultRuleSyntax=v2 in v3.0.0
### Welcome!

- [X] Yes, I've searched similar issues on [GitHub](https://github.com/traefik/traefik/issues) and didn't find any.
- [X] Yes, I've searched similar issues on the [Traefik community forum](https://community.traefik.io) and didn't find any.

### What did you do?

I upgraded to v3 by following the migration guide. For easy migration I changed the default rule syntax to `v2`.

### What did you see instead?

After upgrading I noticed that redirections from HTTP to HTTPS no longer work.

### What version of Traefik are you using?

Version:      3.0.0
Codename:     beaufort
Go version:   go1.22.2
Built:        2024-04-29T14:25:59Z
OS/Arch:      linux/amd64

### What is your environment & configuration?

This is a simple example config:

```yaml
core:
  defaultRuleSyntax: v2

entryPoints:
  web:
    address: :8080
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: http

  websecure:
    address: :8443
```

When opening http://localhost:8080 with this config, there is no redirect to http://localhost:8443:
```
$ curl http://localhost:8080 -vvvv
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Sat, 04 May 2024 05:24:53 GMT
< Content-Length: 19
< 
404 page not found
* Connection #0 to host localhost left intact
```

Without `core.defaultRuleSyntax` it works as expected:
```
$ curl http://localhost:8080 -vvvv
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Location: http://localhost:8443/
< Date: Sat, 04 May 2024 05:25:40 GMT
< Content-Length: 17
< 
* Connection #0 to host localhost left intact
Moved Permanently
```

### If applicable, please paste the log output in DEBUG level

```
WRN pkg/config/static/static_config.go:347 > v2 rules syntax is now deprecated, please use v3 instead...
INF cmd/traefik/traefik.go:100 > Traefik version dev built on I don't remember exactly version=dev
DBG cmd/traefik/traefik.go:107 > Static configuration loaded [json] staticConfiguration={"core":{"defaultRuleSyntax":"v2"},"entryPoints":{"web":{"address":":8080","forwardedHeaders":{},"http":{"redirections":{"entryPoint":{"permanent":true,"priority":9223372036854775806,"scheme":"http","to":"websecure"}}},"http2":{"maxConcurrentStreams":250},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s","readTimeout":"1m0s"}},"udp":{"timeout":"3s"}},"websecure":{"address":":8443","forwardedHeaders":{},"http":{},"http2":{"maxConcurrentStreams":250},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s","readTimeout":"1m0s"}},"udp":{"timeout":"3s"}}},"global":{"checkNewVersion":true},"log":{"format":"common","level":"DEBUG"},"providers":{"providersThrottleDuration":"2s"},"serversTransport":{"maxIdleConnsPerHost":200},"tcpServersTransport":{"dialKeepAlive":"15s","dialTimeout":"30s"}}
INF cmd/traefik/traefik.go:605 > 
Stats collection is disabled.
Help us improve Traefik by turning this feature on :)
More details on: https://doc.traefik.io/traefik/contributing/data-collection/

INF pkg/server/configurationwatcher.go:73 > Starting provider aggregator aggregator.ProviderAggregator
DBG pkg/server/server_entrypoint_tcp.go:220 > Starting TCP Server entryPointName=web
DBG pkg/server/server_entrypoint_tcp.go:220 > Starting TCP Server entryPointName=websecure
INF pkg/provider/aggregator/aggregator.go:202 > Starting provider *traefik.Provider
INF pkg/provider/aggregator/aggregator.go:202 > Starting provider *acme.ChallengeTLSALPN
DBG pkg/provider/aggregator/aggregator.go:203 > *traefik.Provider provider configuration config={}
DBG pkg/provider/aggregator/aggregator.go:203 > *acme.ChallengeTLSALPN provider configuration config={}
DBG pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{"middlewares":{"redirect-web-to-websecure":{"redirectScheme":{"permanent":true,"port":"8443","scheme":"http"}}},"models":{"web":{},"websecure":{}},"routers":{"web-to-websecure":{"entryPoints":["web"],"middlewares":["redirect-web-to-websecure"],"priority":9223372036854775806,"rule":"HostRegexp(`^.+$`)","service":"noop@internal"}},"serversTransports":{"default":{"maxIdleConnsPerHost":200}},"services":{"noop":{}}},"tcp":{"serversTransports":{"default":{"dialKeepAlive":"15s","dialTimeout":"30s"}}},"tls":{},"udp":{}} providerName=internal
DBG pkg/tls/tlsmanager.go:321 > No default certificate, fallback to the internal generated certificate tlsStoreName=default
DBG pkg/middlewares/redirect/redirect_scheme.go:29 > Creating middleware entryPointName=web middlewareName=redirect-web-to-websecure@internal middlewareType=RedirectScheme routerName=web-to-websecure@internal
DBG pkg/middlewares/redirect/redirect_scheme.go:30 > Setting up redirection to http 8443 entryPointName=web middlewareName=redirect-web-to-websecure@internal middlewareType=RedirectScheme routerName=web-to-websecure@internal
DBG pkg/middlewares/recovery/recovery.go:22 > Creating middleware entryPointName=web middlewareName=traefik-internal
```


Discussion / hints:

Fix patch:
diff --git a/pkg/provider/kubernetes/ingress/kubernetes.go b/pkg/provider/kubernetes/ingress/kubernetes.go
index f3f4aa23ed..9411cac6d7 100644
--- a/pkg/provider/kubernetes/ingress/kubernetes.go
+++ b/pkg/provider/kubernetes/ingress/kubernetes.go
@@ -277,9 +277,10 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl
 			}
 
 			rt := &dynamic.Router{
-				Rule:     "PathPrefix(`/`)",
-				Priority: math.MinInt32,
-				Service:  "default-backend",
+				Rule:       "PathPrefix(`/`)",
+				RuleSyntax: "v3",
+				Priority:   math.MinInt32,
+				Service:    "default-backend",
 			}
 
 			if rtConfig != nil && rtConfig.Router != nil {
diff --git a/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json b/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json
index 38a75d6b3b..c463389928 100644
--- a/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json
+++ b/pkg/provider/traefik/fixtures/api_insecure_with_dashboard.json
@@ -7,6 +7,7 @@
         ],
         "service": "api@internal",
         "rule": "PathPrefix(`/api`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775806
       },
       "dashboard": {
@@ -19,6 +20,7 @@
         ],
         "service": "dashboard@internal",
         "rule": "PathPrefix(`/`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775805
       }
     },
diff --git a/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json b/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json
index 9a98c0a1d4..6b59286088 100644
--- a/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json
+++ b/pkg/provider/traefik/fixtures/api_insecure_without_dashboard.json
@@ -7,6 +7,7 @@
         ],
         "service": "api@internal",
         "rule": "PathPrefix(`/api`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775806
       }
     },
diff --git a/pkg/provider/traefik/fixtures/full_configuration.json b/pkg/provider/traefik/fixtures/full_configuration.json
index ed0ebfba69..24597958db 100644
--- a/pkg/provider/traefik/fixtures/full_configuration.json
+++ b/pkg/provider/traefik/fixtures/full_configuration.json
@@ -7,6 +7,7 @@
         ],
         "service": "api@internal",
         "rule": "PathPrefix(`/api`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775806
       },
       "dashboard": {
@@ -19,6 +20,7 @@
         ],
         "service": "dashboard@internal",
         "rule": "PathPrefix(`/`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775805
       },
       "debug": {
@@ -27,6 +29,7 @@
         ],
         "service": "api@internal",
         "rule": "PathPrefix(`/debug`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775806
       },
       "ping": {
@@ -35,6 +38,7 @@
         ],
         "service": "ping@internal",
         "rule": "PathPrefix(`/ping`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775807
       },
       "prometheus": {
@@ -43,6 +47,7 @@
         ],
         "service": "prometheus@internal",
         "rule": "PathPrefix(`/metrics`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775807
       },
       "rest": {
@@ -51,6 +56,7 @@
         ],
         "service": "rest@internal",
         "rule": "PathPrefix(`/api/providers`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775807
       }
     },
diff --git a/pkg/provider/traefik/fixtures/ping_simple.json b/pkg/provider/traefik/fixtures/ping_simple.json
index 6f159dce53..9e74ee0e3e 100644
--- a/pkg/provider/traefik/fixtures/ping_simple.json
+++ b/pkg/provider/traefik/fixtures/ping_simple.json
@@ -7,6 +7,7 @@
         ],
         "service": "ping@internal",
         "rule": "PathPrefix(`/ping`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775807
       }
     },
diff --git a/pkg/provider/traefik/fixtures/prometheus_simple.json b/pkg/provider/traefik/fixtures/prometheus_simple.json
index b636b4569f..b385f6c9d5 100644
--- a/pkg/provider/traefik/fixtures/prometheus_simple.json
+++ b/pkg/provider/traefik/fixtures/prometheus_simple.json
@@ -7,6 +7,7 @@
         ],
         "service": "prometheus@internal",
         "rule": "PathPrefix(`/metrics`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775807
       }
     },
diff --git a/pkg/provider/traefik/fixtures/redirection.json b/pkg/provider/traefik/fixtures/redirection.json
index 73ae77db34..a62480281f 100644
--- a/pkg/provider/traefik/fixtures/redirection.json
+++ b/pkg/provider/traefik/fixtures/redirection.json
@@ -9,7 +9,8 @@
           "redirect-web-to-websecure"
         ],
         "service": "noop@internal",
-        "rule": "HostRegexp(`^.+$`)"
+        "rule": "HostRegexp(`^.+$`)",
+        "ruleSyntax": "v3"
       }
     },
     "services": {
diff --git a/pkg/provider/traefik/fixtures/redirection_port.json b/pkg/provider/traefik/fixtures/redirection_port.json
index a9e75438a9..05ef94a7e4 100644
--- a/pkg/provider/traefik/fixtures/redirection_port.json
+++ b/pkg/provider/traefik/fixtures/redirection_port.json
@@ -9,7 +9,8 @@
           "redirect-web-to-443"
         ],
         "service": "noop@internal",
-        "rule": "HostRegexp(`^.+$`)"
+        "rule": "HostRegexp(`^.+$`)",
+        "ruleSyntax": "v3"
       }
     },
     "services": {
diff --git a/pkg/provider/traefik/fixtures/redirection_with_protocol.json b/pkg/provider/traefik/fixtures/redirection_with_protocol.json
index 73ae77db34..a62480281f 100644
--- a/pkg/provider/traefik/fixtures/redirection_with_protocol.json
+++ b/pkg/provider/traefik/fixtures/redirection_with_protocol.json
@@ -9,7 +9,8 @@
           "redirect-web-to-websecure"
         ],
         "service": "noop@internal",
-        "rule": "HostRegexp(`^.+$`)"
+        "rule": "HostRegexp(`^.+$`)",
+        "ruleSyntax": "v3"
       }
     },
     "services": {
diff --git a/pkg/provider/traefik/fixtures/rest_insecure.json b/pkg/provider/traefik/fixtures/rest_insecure.json
index e11a84e778..a9e13e02d8 100644
--- a/pkg/provider/traefik/fixtures/rest_insecure.json
+++ b/pkg/provider/traefik/fixtures/rest_insecure.json
@@ -7,6 +7,7 @@
         ],
         "service": "rest@internal",
         "rule": "PathPrefix(`/api/providers`)",
+        "ruleSyntax": "v3",
         "priority": 9223372036854775807
       }
     },
diff --git a/pkg/provider/traefik/internal.go b/pkg/provider/traefik/internal.go
index 7a78703d07..1f1b09a52a 100644
--- a/pkg/provider/traefik/internal.go
+++ b/pkg/provider/traefik/internal.go
@@ -106,6 +106,7 @@ func (i *Provider) acme(cfg *dynamic.Configuration) {
 	if len(eps) > 0 {
 		rt := &dynamic.Router{
 			Rule:        "PathPrefix(`/.well-known/acme-challenge/`)",
+			RuleSyntax:  "v3",
 			EntryPoints: eps,
 			Service:     "acme-http@internal",
 			Priority:    math.MaxInt,
@@ -141,6 +142,7 @@ func (i *Provider) redirection(ctx context.Context, cfg *dynamic.Configuration)
 
 		rt := &dynamic.Router{
 			Rule:        "HostRegexp(`^.+$`)",
+			RuleSyntax:  "v3",
 			EntryPoints: []string{name},
 			Middlewares: []string{mdName},
 			Service:     "noop@internal",
@@ -241,6 +243,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) {
 			Service:     "api@internal",
 			Priority:    math.MaxInt - 1,
 			Rule:        "PathPrefix(`/api`)",
+			RuleSyntax:  "v3",
 		}
 
 		if i.staticCfg.API.Dashboard {
@@ -249,6 +252,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) {
 				Service:     "dashboard@internal",
 				Priority:    math.MaxInt - 2,
 				Rule:        "PathPrefix(`/`)",
+				RuleSyntax:  "v3",
 				Middlewares: []string{"dashboard_redirect@internal", "dashboard_stripprefix@internal"},
 			}
 
@@ -270,6 +274,7 @@ func (i *Provider) apiConfiguration(cfg *dynamic.Configuration) {
 				Service:     "api@internal",
 				Priority:    math.MaxInt - 1,
 				Rule:        "PathPrefix(`/debug`)",
+				RuleSyntax:  "v3",
 			}
 		}
 	}
@@ -292,6 +297,7 @@ func (i *Provider) pingConfiguration(cfg *dynamic.Configuration) {
 			Service:     "ping@internal",
 			Priority:    math.MaxInt,
 			Rule:        "PathPrefix(`/ping`)",
+			RuleSyntax:  "v3",
 		}
 	}
 
@@ -309,6 +315,7 @@ func (i *Provider) restConfiguration(cfg *dynamic.Configuration) {
 			Service:     "rest@internal",
 			Priority:    math.MaxInt,
 			Rule:        "PathPrefix(`/api/providers`)",
+			RuleSyntax:  "v3",
 		}
 	}
 
@@ -326,6 +333,7 @@ func (i *Provider) prometheusConfiguration(cfg *dynamic.Configuration) {
 			Service:     "prometheus@internal",
 			Priority:    math.MaxInt,
 			Rule:        "PathPrefix(`/metrics`)",
+			RuleSyntax:  "v3",
 		}
 	}
 


Test patch:
diff --git a/integration/testdata/rawdata-consul.json b/integration/testdata/rawdata-consul.json
index 0888c3af91..84132ed452 100644
--- a/integration/testdata/rawdata-consul.json
+++ b/integration/testdata/rawdata-consul.json
@@ -53,6 +53,7 @@
       ],
       "service": "api@internal",
       "rule": "PathPrefix(`/api`)",
+      "ruleSyntax": "v3",
       "priority": 9223372036854775806,
       "status": "enabled",
       "using": [
@@ -69,6 +70,7 @@
       ],
       "service": "dashboard@internal",
       "rule": "PathPrefix(`/`)",
+      "ruleSyntax": "v3",
       "priority": 9223372036854775805,
       "status": "enabled",
       "using": [
diff --git a/integration/testdata/rawdata-etcd.json b/integration/testdata/rawdata-etcd.json
index 18ed673e3e..ffb03d9ac0 100644
--- a/integration/testdata/rawdata-etcd.json
+++ b/integration/testdata/rawdata-etcd.json
@@ -53,6 +53,7 @@
       ],
       "service": "api@internal",
       "rule": "PathPrefix(`/api`)",
+      "ruleSyntax": "v3",
       "priority": 9223372036854775806,
       "status": "enabled",
       "using": [
@@ -69,6 +70,7 @@
       ],
       "service": "dashboard@internal",
       "rule": "PathPrefix(`/`)",
+      "ruleSyntax": "v3",
       "priority": 9223372036854775805,
       "status": "enabled",
       "using": [
diff --git a/integration/testdata/rawdata-gateway.json b/integration/testdata/rawdata-gateway.json
index c479602574..08bd34802a 100644
--- a/integration/testdata/rawdata-gateway.json
+++ b/integration/testdata/rawdata-gateway.json
@@ -6,6 +6,7 @@
 			],
 			"service": "api@internal",
 			"rule": "PathPrefix(`/api`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775806,
 			"status": "enabled",
 			"using": [
@@ -22,6 +23,7 @@
 			],
 			"service": "dashboard@internal",
 			"rule": "PathPrefix(`/`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775805,
 			"status": "enabled",
 			"using": [
diff --git a/integration/testdata/rawdata-ingress-label-selector.json b/integration/testdata/rawdata-ingress-label-selector.json
index 703f6dd95d..e0351ce0eb 100644
--- a/integration/testdata/rawdata-ingress-label-selector.json
+++ b/integration/testdata/rawdata-ingress-label-selector.json
@@ -6,6 +6,7 @@
 			],
 			"service": "api@internal",
 			"rule": "PathPrefix(`/api`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775806,
 			"status": "enabled",
 			"using": [
@@ -22,6 +23,7 @@
 			],
 			"service": "dashboard@internal",
 			"rule": "PathPrefix(`/`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775805,
 			"status": "enabled",
 			"using": [
diff --git a/integration/testdata/rawdata-ingress.json b/integration/testdata/rawdata-ingress.json
index 7cd63e333d..febc172d4e 100644
--- a/integration/testdata/rawdata-ingress.json
+++ b/integration/testdata/rawdata-ingress.json
@@ -6,6 +6,7 @@
 			],
 			"service": "api@internal",
 			"rule": "PathPrefix(`/api`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775806,
 			"status": "enabled",
 			"using": [
@@ -22,6 +23,7 @@
 			],
 			"service": "dashboard@internal",
 			"rule": "PathPrefix(`/`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775805,
 			"status": "enabled",
 			"using": [
diff --git a/integration/testdata/rawdata-ingressclass-disabled.json b/integration/testdata/rawdata-ingressclass-disabled.json
index 458fc2e1bf..bbf4d6141d 100644
--- a/integration/testdata/rawdata-ingressclass-disabled.json
+++ b/integration/testdata/rawdata-ingressclass-disabled.json
@@ -6,6 +6,7 @@
 			],
 			"service": "api@internal",
 			"rule": "PathPrefix(`/api`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775806,
 			"status": "enabled",
 			"using": [
@@ -22,6 +23,7 @@
 			],
 			"service": "dashboard@internal",
 			"rule": "PathPrefix(`/`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775805,
 			"status": "enabled",
 			"using": [
diff --git a/integration/testdata/rawdata-ingressclass.json b/integration/testdata/rawdata-ingressclass.json
index 346396d6c2..3fe8333e11 100644
--- a/integration/testdata/rawdata-ingressclass.json
+++ b/integration/testdata/rawdata-ingressclass.json
@@ -6,6 +6,7 @@
 			],
 			"service": "api@internal",
 			"rule": "PathPrefix(`/api`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775806,
 			"status": "enabled",
 			"using": [
@@ -22,6 +23,7 @@
 			],
 			"service": "dashboard@internal",
 			"rule": "PathPrefix(`/`)",
+			"ruleSyntax": "v3",
 			"priority": 9223372036854775805,
 			"status": "enabled",
 			"using": [
diff --git a/integration/testdata/rawdata-redis.json b/integration/testdata/rawdata-redis.json
index 182276fcb0..4f8e8498ac 100644
--- a/integration/testdata/rawdata-redis.json
+++ b/integration/testdata/rawdata-redis.json
@@ -53,6 +53,7 @@
       ],
       "service": "api@internal",
       "rule": "PathPrefix(`/api`)",
+      "ruleSyntax": "v3",
       "priority": 9223372036854775806,
       "status": "enabled",
       "using": [
@@ -69,6 +70,7 @@
       ],
       "service": "dashboard@internal",
       "rule": "PathPrefix(`/`)",
+      "ruleSyntax": "v3",
       "priority": 9223372036854775805,
       "status": "enabled",
       "using": [
diff --git a/integration/testdata/rawdata-zk.json b/integration/testdata/rawdata-zk.json
index 7381d8c27a..b06c6974ce 100644
--- a/integration/testdata/rawdata-zk.json
+++ b/integration/testdata/rawdata-zk.json
@@ -53,6 +53,7 @@
       ],
       "service": "api@internal",
       "rule": "PathPrefix(`/api`)",
+      "ruleSyntax": "v3",
       "priority": 9223372036854775806,
       "status": "enabled",
       "using": [
@@ -69,6 +70,7 @@
       ],
       "service": "dashboard@internal",
       "rule": "PathPrefix(`/`)",
+      "ruleSyntax": "v3",
       "priority": 9223372036854775805,
       "status": "enabled",
       "using": [
diff --git a/pkg/provider/kubernetes/ingress/kubernetes_test.go b/pkg/provider/kubernetes/ingress/kubernetes_test.go
index 273a99260c..bb2ab2d4b5 100644
--- a/pkg/provider/kubernetes/ingress/kubernetes_test.go
+++ b/pkg/provider/kubernetes/ingress/kubernetes_test.go
@@ -528,9 +528,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
 					Middlewares: map[string]*dynamic.Middleware{},
 					Routers: map[string]*dynamic.Router{
 						"default-router": {
-							Rule:     "PathPrefix(`/`)",
-							Service:  "default-backend",
-							Priority: math.MinInt32,
+							Rule:       "PathPrefix(`/`)",
+							RuleSyntax: "v3",
+							Service:    "default-backend",
+							Priority:   math.MinInt32,
 						},
 					},
 					Services: map[string]*dynamic.Service{
@@ -993,9 +994,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
 					Middlewares: map[string]*dynamic.Middleware{},
 					Routers: map[string]*dynamic.Router{
 						"default-router": {
-							Rule:     "PathPrefix(`/`)",
-							Service:  "default-backend",
-							Priority: math.MinInt32,
+							Rule:       "PathPrefix(`/`)",
+							RuleSyntax: "v3",
+							Service:    "default-backend",
+							Priority:   math.MinInt32,
 						},
 					},
 					Services: map[string]*dynamic.Service{
@@ -1469,9 +1471,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
 					Middlewares: map[string]*dynamic.Middleware{},
 					Routers: map[string]*dynamic.Router{
 						"default-router": {
-							Rule:     "PathPrefix(`/`)",
-							Priority: math.MinInt32,
-							Service:  "default-backend",
+							Rule:       "PathPrefix(`/`)",
+							RuleSyntax: "v3",
+							Priority:   math.MinInt32,
+							Service:    "default-backend",
 						},
 					},
 					Services: map[string]*dynamic.Service{