Skip to content

traefik

Key concepts are:

  1. routers
  2. entrypoints
  3. middleware
  4. services
Traefik Schema

traefik schema

Unifi Controller

Middleware needs to be referenced by a router in docker labels.

For Unifi controller, running in docker behind a reverse proxy, need to add to traefik.yml (probably good to do in general so different configuration files can sit in that directory)

traefik.yml
providers:
  directory: /path

Then need to expose that path in docker-compose.yml and then can place http.yml there with the following

http.tyml
http:
  middlewares:
    unifiHeaders:
      headers:
        customRequestHeaders:
          Authorization: "" # Removes
This http.yml file will then be referenced with the label in the unifi conrtoller docker-compose.yml
docker-compose.yml
- traefik.http.routers.unifi.middlewares=unifiHeaders@file

Still todo: try ditching the certificate definitions in unifi docker-compose