Redirectscheme not working with multiple Domains

Im having an issue with the redirectscheme middleware.
Im doing the http->https redirect per container for reasons, and all the https listeners and certs work perfectly... What doesnt work, are all of my host rules. when I access hxxp://DOMAIN1 i get redirected to hxxps://DOMAIN1 as expected... but when I access hxxp://www.DOMAIN1 hxxp://DOMAIN2 or hxxp://www.DOMAIN2 i get 404 errors, and the logs show that I am not hitting any rules.
My docker-compose is below, does anyone have any ideas?
(excuse the hxxp stuff, i'm new, and the system doesn't want me to post URLs.)

- - [17/Apr/2023:13:38:10 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 915 "-" "-" 0ms

version: '3.3'
      - './site:/var/www/html'
    build: .
    restart: "unless-stopped"
      traefik.enable: true
      traefik.http.routers.containername-php.entrypoints: web
      traefik.http.routers.containername-php.rule: "Host(`DOMAIN1`) || Host(`www.DOMAIN1`) || Host(`DOMAIN2`) || Host(`www.DOMAIN2`)"
      traefik.http.routers.containername-php.middlewares: containername-php
      traefik.http.middlewares.containername-php.redirectscheme.scheme: https
      traefik.http.routers.containername-php.entrypoints: websecure
      traefik.http.routers.containername-php.rule: "Host(`DOMAIN1`) || Host(`www.DOMAIN1`) || Host(`DOMAIN2`) || Host(`www.DOMAIN2`)"
      traefik.http.routers.containername-php.tls: true
      traefik.http.routers.containername-php.tls.certresolver: production

      - traefik-internal

    name: traefik-internal
    external: true

You need to use different router names (like containername-php and containername-php-tls), otherwise you „overwrite“ them.

You're a hero, I cant believe i missed that...


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.