Redirect dashboard to https

I have a global redirect to https set up and it is working for all my services except the traefik dashboard itself. What am I missing here?

  traefik:
    image: traefik
    container_name: traefik
    restart: always
    networks:
      - proxy
    ports:
      - 443:443/tcp
      - 80:80/tcp
    environment:
      - CF_API_EMAIL=$CLOUDFLARE_EMAIL
      - CF_API_KEY=$CLOUDFLARE_API_KEY
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:rw
      - $DOCKERDIR/traefik/acme.json:/acme.json:rw
      - $DOCKERDIR/traefik/dynamic.toml:/dynamic.toml:rw
      - $DOCKERDIR/traefik/traefik.toml:/traefik.toml:rw
    command:
      - --entrypoints.web-secure.http.tls.domains[0].main=$DOMAINNAME
      - --entrypoints.web-secure.http.tls.domains[0].sans=*.$DOMAINNAME
    labels:
      traefik.enable: true
      traefik.http.middlewares.authme.forwardauth.address: http://authelia:9091/api/verify?rd=https://authelia.$DOMAINNAME/
      traefik.http.middlewares.authme.forwardauth.authresponseheaders: X-Forwarded-User
      traefik.http.middlewares.authme.forwardauth.trustforwardheader: true
      traefik.http.middlewares.https-redirect.redirectscheme.scheme: https
      traefik.http.routers.https-redirect.entrypoints: web
      traefik.http.routers.https-redirect.middlewares: https-redirect
      traefik.http.routers.https-redirect.rule: HostRegexp(`{host:.+}`)
      traefik.http.routers.traefik.entrypoints: web,web-secure
      traefik.http.routers.traefik.middlewares: authme
      traefik.http.routers.traefik.rule: Host(`traefik.$DOMAINNAME`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
      traefik.http.routers.traefik.service: api@internal
[entryPoints]
  [entryPoints.web]
    address = ":80"
  [entryPoints.web-secure]
    address = ":443"
      [entryPoints.web-secure.http.tls]
        certResolver = "default"
  [entryPoints.metrics]
    address = ":8082"

[api]
  dashboard = true
  insecure = false

Remove web from the router's entrypoints.

I would recommend doing the https redirect on the entrypoint:

--entrypoints.foo.http.redirections.entryPoint.to=web-secure
--entrypoints.foo.http.redirections.entryPoint.scheme=https
--entrypoints.foo.http.redirections.entrypoint.permanent=true

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