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

Hello, I was wondering if you ever figured this out? I am also struggling to get the combination of Filebrowser, Traefik, and Authelia working together. I would be curious to see your Filebrowser docker-compose file if you were successful, thank you.

Hi, I didn't take the time to retry Tom's guidance, as yet, I will
However, if it can help, I did it the old way, so pls find below my docker-compose with both Traefik and Authelia working:
version: "2"
services:
filebrowser:
image: hurlenko/filebrowser
container_name: filebrowser
environment:
- USER_ID=1000
- GROUP_ID=100
- FB_BASEURL=/filebrowser
networks:
- traefik_proxy
expose:
- 8080
volumes:
- /srv/Users:/data/Users
- /srv/Multimedia:/data/Multimedia
- /srv/Tech:/data/Tech
- /srv/Docker/filebrowser:/config
labels:
- "traefik.enable=true"
- "traefik.http.routers.filebrowser.rule=Host(drive.DOMAIN.fr)"
- "traefik.http.routers.filebrowser.entrypoints=http,https"
- "traefik.http.middlewares.https-only.redirectscheme.scheme=https"
- "traefik.http.routers.filebrowser.tls=true"
- "traefik.http.routers.filebrowser.tls.certresolver=leresolver"
- "traefik.http.routers.filebrowser.middlewares=authelia@docker"
- "diun.enable=true"
- "traefik.docker.network=traefik_proxy"

restart: unless-stopped

networks:
default:
traefik_proxy:
external:
name: traefik_proxy