Now if we were to put everything together into our dynamic Traefik config file, it would look something like the below. Use your favourite method for adding/editing the file and paste in the below. In our example we will use the simple command line file editor nano. Anywhere you see YOURDOMAIN.COM, make sure to change that out for your own domain.
nano /mnt/user/appdata/traefik/fileConfig.yml
fileConfig.yml
http:## EXTERNAL ROUTING - Only use if you want to proxy something manually ##routers:# Homeassistant routing - Remove if not usedhomeassistant:entryPoints: - httpsrule:'Host(`homeassistant.domain.com`)'service:homeassistantmiddlewares: - "auth"## SERVICES ##services:# Homeassistant service - Remove if not usedhomeassistant:loadBalancer:servers: - url:http://192.168.60.5:8123/## MIDDLEWARES ##middlewares:# Only Allow Local networkslocal-ipwhitelist:ipWhiteList:sourceRange: - 127.0.0.1/32# localhost - 192.168.1.1/24# LAN Subnet# Authelia guardauth:forwardauth: address: http://auth:9091/api/verify?rd=https://auth.domain.com/ # replace auth with your authelia container name
trustForwardHeader:trueauthResponseHeaders: - Remote-User - Remote-Groups - Remote-Name - Remote-Email# Authelia basic auth guardauth-basic:forwardauth:address:http://auth:9091/api/verify?auth=basic# replace auth with your authelia container nametrustForwardHeader:trueauthResponseHeaders: - Remote-User - Remote-Groups - Remote-Name - Remote-Email# Security headerssecurityHeaders:headers:customResponseHeaders:X-Robots-Tag:"none,noarchive,nosnippet,notranslate,noimageindex"X-Forwarded-Proto:"https"server:""customRequestHeaders:X-Forwarded-Proto:"https"sslProxyHeaders:X-Forwarded-Proto:"https"referrerPolicy:"same-origin"hostsProxyHeaders: - "X-Forwarded-Host"contentTypeNosniff:truebrowserXssFilter:trueforceSTSHeader:truestsIncludeSubdomains:truestsSeconds:63072000stsPreload:true# Only use secure ciphers - https://ssl-config.mozilla.org/#server=traefik&version=2.6.0&config=intermediate&guideline=5.6
tls:options:default:minVersion:VersionTLS12cipherSuites: - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305