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 it 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 /opt/appdata/traefik/fileConfig.yml
fileConfig.yml
http:## EXTERNAL ROUTING EXAMPLE - Only use if you want to proxy something manually ##routers:# Homeassistant routing example - Remove if not usedhomeassistant:entryPoints: - httpsrule:'Host(`homeassistant.domain.com`)'service:homeassistantmiddlewares: - "auth"## SERVICES EXAMPLE ##services:# Homeassistant service example - 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 nametrustForwardHeader: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"server:""X-Forwarded-Proto:"https"sslProxyHeaders:X-Forwarded-Proto:httpsreferrerPolicy:"strict-origin-when-cross-origin"hostsProxyHeaders: - "X-Forwarded-Host"customRequestHeaders:X-Forwarded-Proto:"https"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.6tls: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