Hi guys, I am struggling with a docker setup and a redirect issue, maybe someone can help?
Basically, all is working for other containers, but I can not reach the traefik subdomain (301). My guess is the https rewrite causes trouble?
Using docker, traefikv2.4
Setup:
traefik
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--certificatesResolvers.le.acme.email=EMAIL"
- "--certificatesResolvers.le.acme.storage=acme.json"
- "--certificatesResolvers.le.acme.tlsChallenge=true"
- "--certificatesResolvers.le.acme.httpChallenge=true"
- "--certificatesResolvers.le.acme.httpChallenge.entryPoint=web"
...
ports:
# The HTTP port
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "8181:8080"
...
labels:
# setup to redirect all http to https
- traefik.enable=true
- traefik.http.routers.http_catchall.rule=HostRegexp(`{any:.+}`)
- traefik.http.routers.http_catchall.entrypoints=web
- traefik.http.routers.http_catchall.middlewares=https_redirect
- 'traefik.http.routers.http-catchall.priority=1000' # no effect
- traefik.http.middlewares.https_redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https_redirect.redirectscheme.permanent=true
# now setup of traefik admin interface
- "traefik.http.routers.traefik.rule=Host(`traefik.DOMAIN`)"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.tls.certresolver=le"
# auth middleware with user / password
- "traefik.http.middlewares.my-auth.basicauth.users=user:pw"
other containers that work:
labels:
- "traefik.http.routers.superset.rule=Host(`superset.DOMAIN`)"
- "traefik.http.routers.superset.entrypoints=websecure"
- "traefik.http.routers.superset.tls.certresolver=le"
# connect your auth middleware to a service which you want to protect
- "traefik.http.routers.superset.middlewares=my-auth"