Traefik labels and chains

Hi all,
I can't get chains to work with docker labels. I have the following in my "filebrowser" container under the 'Labels:' section. I hit Authelia and authenticate correctly, but I don't get automatic https redirection. I have tried many variants, to no avail. Can some help, please?
- "traefik.enable=true"
- "traefik.http.routers.filebrowser.entrypoints=http"
- "traefik.http.routers.filebrowser.rule=Host(drive.domain.fr)"
- "traefik.http.middlewares.filebrowser-https-redirect.redirectscheme.scheme=https"
Deactivated with a dash - "traefik.http.routers.filebrowser.middlewares=filebrowser-https-redirect"
- "traefik.http.routers.filebrowser-secure.entrypoints=https"
- "traefik.http.routers.filebrowser-secure.rule=Host(drive.domain.fr)"
- "traefik.http.routers.filebrowser-secure.tls=true"
- "traefik.http.routers.filebrowser-secure.tls.certresolver=le"
Deactivated with a dash - "traefik.http.middlewares.filebrowser.XXXXX=authelia@docker"
- "traefik.http.routers.filebrowser-secure.middlewares=secured"
- "traefik.http.middlewares.secured.chain.middlewares=filebrowser-https-redirect,authelia@docker"
- "traefik.docker.network=traefik_proxy"

Can anyone please give a working example of a traefik "chain" described in the "labels" format (not the toml or yaml).
That will help as I can't get it to work.
Many thanks in advance

Hello @tugdualenligne,

Does Traefik Command Line Documentation - Traefik is not enough for you ?

Here's a full example for you
version: '3.9'

services:
  traefik:
    image: traefik:v2.7
    command:
      - --api.insecure=true
      - --providers.docker
      - --log.level=DEBUG
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

  whoami:
    image: traefik/whoami # https://github.com/traefik/whoami
    labels:
      traefik.http.routers.whoami.rule: Host(`whoami.localhost`)
      traefik.http.routers.whoami.middlewares: secured
      traefik.http.middlewares.secured.chain.middlewares: https-only,known-ips,auth-users
      traefik.http.middlewares.auth-users.basicauth.users: test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/
      traefik.http.middlewares.https-only.redirectscheme.scheme: https
      traefik.http.middlewares.known-ips.ipwhitelist.sourceRange: 192.168.1.7,127.0.0.1/32

Hi Tom,
I won’t say it is not enough ;-), but rather that I couldn’t get it working from the documentation.
I’ll give it another try from your example, thanks!
Bon WE de Pâques

1 Like