Hello everyone,
i have some problem with the v2 version, in particular with https and redirect from http to https.
I read the documentation and i follow it in order to setup traefik but there is something wrong in my config (i think)
So..i have a valid certificate on my host. It's no a Let's Encrypt cert.
I setup traefik as a follows:
traefik.yml file
log:
level: DEBUG
api:
insecure: true
dashboard: true
debug: true
providers:
file:
filename: "/etc/traefik/traefik.config.yml"
watch: true
docker:
exposedByDefault: false
entrypoints:
traefik:
address: ":8080"
http:
address: ":80"
secure:
address: ":433"
traefik.config.yml
http:
routers:
router1:
rule: "Host(`MY-DOMAIN`) && PathPrefix(`/MY-PREFIX`)"
service: service1
services:
service1:
loadBalancer:
servers:
- url: "MY-EXTERNAL-SERVICE"
tls:
certificates:
- certFile: /PATH/TO/MY/CERTS/mydomain.crt
keyFile: /PATH/TO/MY/CERTS/mydomain.key
Morover i have a frontend in a contanier that it respond to the request https://MY-DOMAIN and the setup of this is as follow:
labels:
- "traefik.http.routers.routerX.entrypoints=http"
- "traefik.http.routers.routerX.rule=Host(`MY-DOMAIN`)"
- "traefik.http.routers.routerX.middlewares=my_redirect"
- "traefik.http.middlewares.my_redirect.redirectscheme.scheme=https"
- "traefik.http.routers.routerX_https.entrypoints=secure"
- "traefik.http.routers.routerX_https.rule=Host(`MY_DOMAIN`)"
- "traefik.http.routers.routerX_https.tls=true"
Where or What i wrog?
Thanks for any suggestions