In addition to the above you must also assure that the environment variable WAN_HOSTNAME is known in the traefik container. ( 2.1) For this I have defined the environment variable in the .env file (in same folder as my docker-compose.yml) and (2.2) I have added this environment variable to my traefik service definition in my docker-compose.yml as follows:
traefik:
build: traefik
container_name: "traefik"
...
environment:
# WAN_HOSTNAME is used in traefik config.yml file !
- WAN_HOSTNAME
labels:
- "traefik.enable=true"
...