Hello,
I want to be able to set https redirects manually per router.
To achieve i tried the following.
I setup a simple Scheme Redirect in a file provider:
http:
middlewares:
https-redirect:
redirectScheme:
scheme: https
permanent: true
and then for containers that should be redirected i set it up with 2 routers
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard-http.rule=Host(`traefik.SOMEURL.COM`)"
- "traefik.http.routers.dashboard-http.entrypoints=web"
- "traefik.http.routers.dashboard-http.middlewares=https-redirect@file"
- "traefik.http.routers.dashboard.rule=Host(`traefik.SOMEURL.COM`)"
- "traefik.http.routers.dashboard.entrypoints=websecure"
- "traefik.http.routers.dashboard.tls.certresolver=letsencrypt"
and for containers that should only have http i just setup one router
labels:
- "traefik.enable=true"
- "traefik.http.routers.test-http.rule=Host(`test.SOMEURL.COM`)"
- "traefik.http.routers.test-http.entrypoints=web"
From my unterstanding this should mean i can reach http://test.SOMEURL.COM
yet for some reason it still redirects to https with a 307 Temporary Redirect
The dashboard shows that the test-http routes does not have the redirect middleware applied.
the entrypoints defined in the config look like this:
entryPoints:
web:
address: :80
websecure:
address: :443
http:
tls: true
So what am i overlooking here?
on a sidenote. shoudn’t the “permanent: true” flag in the middleware mean that redirects are permanent, as in 308 or something? Even on the containers with the middleware they redirect with 307.