У вас было две точки входа «web» и «websecure». Таким образом, вы можете установить два маршрутизатора, это выглядит следующим образом:
Для http:
- "traefik.http.routers.exampleforhttp.rule=Host(`example.com`)"
- "traefik.http.routers.exampleforhttp.entrypoints=web"
Для https:
- "traefik.http.routers.exampleforhttps.rule=Host(`example.com`)"
- "traefik.http.routers.exampleforhttps.entrypoints=websecure"
- "traefik.http.routers.exampleforhttps.tls.certresolver=mytlschallenge"
Или вы хотите перенаправить http на https, как удар:
- "traefik.http.routers.exampleforhttp.rule=Host(`example.com`)"
- "traefik.http.routers.exampleforhttp.entrypoints=web"
- "traefik.http.routers.exampleforhttp.middlewares=http-redirect"
- "traefik.http.middlewares.http-redirect.redirectscheme.scheme=https
- "traefik.http.routers.exampleforhttps.rule=Host(`example.com`)"
- "traefik.http.routers.exampleforhttps.entrypoints=websecure"
- "traefik.http.routers.exampleforhttps.tls.certresolver=mytlschallenge"
Хорошо провести время.