We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I upgraded to v3 by following the migration guide. For easy migration I changed the default rule syntax to v2.
v2
After upgrading I noticed that redirections from HTTP to HTTPS no longer work.
Version: 3.0.0 Codename: beaufort Go version: go1.22.2 Built: 2024-04-29T14:25:59Z OS/Arch: linux/amd64
This is a simple example config:
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:
core.defaultRuleSyntax
$ 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
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
The text was updated successfully, but these errors were encountered:
Closed by #10689.
Sorry, something went wrong.
No branches or pull requests
Welcome!
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:
When opening http://localhost:8080 with this config, there is no redirect to http://localhost:8443:
Without
core.defaultRuleSyntax
it works as expected:If applicable, please paste the log output in DEBUG level
The text was updated successfully, but these errors were encountered: