dakky
September 30, 2019, 5:54am
1
Hello
Maybe someone can help me. I try to redirect all requests from http to https
hier is my config:
## Dynamic configuration
http:
routers:
backup:
entryPoints:
- "web"
- "websecure"
tls: {}
rule: "Host(`backup.mydomain.com`)"
middlewares:
- "backup-ssl-redirect"
service: "backup"
services:
backup:
loadBalancer:
servers:
- url: "http://localhost:8082"
middlewares:
backup-ssl-redirect:
redirectScheme:
scheme: "https"
permanent: true
browsing the URL results in a 404 Not Found
zespri
September 30, 2019, 6:12am
2
Hello,
there is an example that use redirect here:
I created a simple working example (no swarm, no let's encrypt, no file): version: "3" services: traefik: image: traefik:v2.0.0 ports: - "80:80" - "443:443" command: - --global.checkNewVersion=true -...
It's docker but can be translated to a file.
Yours does not look like it's going to work because it creates a tls router but does not create a non-tls one, thus it cannot match on a plain http request. When that's fixed, there could be further impediments depending on the fix.
1 Like
dakky
September 30, 2019, 8:29am
3
hmm I followed the docs here:
https://docs.traefik.io/routing/routers/#entrypoints
This states, that I need one router, accepting the two entrypoints for http/https?
zespri
September 30, 2019, 6:28pm
4
You need two routers. While one router can accept requests from multiple entry points, as the doco says, it cannot accept both http and https at the same time.
dakky
October 1, 2019, 6:23am
5
fixed. the marked answer was the solution
Thanks