Using a subdomain per container rederirect everything to the Traefik container

Hello, I'm discovering Traefik and I'm trying to have a setup where each domain would redirect to a container. Here is the first step I did

version: '3'

services:
  reverse-proxy:
    image: traefik:2.0
    command: --api.insecure=true --providers.docker --log.level="DEBUG" --log.filePath="traefik.log" --accesslog=true
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
  wordpress:
    image: wordpress
    labels:
      - "traefik.http.routers.whoami.rule=Host(`wordpress.localhost`)"

What's happening with that is that going to localhost I end up on the Traefik 404 page, localhost:8080 goes to the admin and wordpress.localhost goes to the Wordpress container. Everything is for the best.

But, when I want to add a second container with, let's say

...
  drupal:
    image: drupal
    labels:
      - "traefik.http.routers.whoami.rule=Host(`drupal.localhost`)"

Everything (except localhost:8080) is displaying the Traefik 404 page. What am I missing in the config?

I'm new to traefik too, but have you tried renaming your drupal router?

- "traefik.http.routers.some-other-name.rule=Host(`drupal.localhost`)"

Hello,

The router name must be unique:

"traefik.http.routers.whoami.rule=Host(`wordpress.localhost`)"

## -->

"traefik.http.routers.wordpress.rule=Host(`wordpress.localhost`)"
version: '3'

services:
  reverse-proxy:
    image: traefik:2.0
    command: --api.insecure=true --providers.docker --log.level=DEBUG --log.filePath=traefik.log --accesslog=true
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
  wordpress:
    image: wordpress
    labels:
      - "traefik.http.routers.wordpress.rule=Host(`wordpress.localhost`)"
#...
  drupal:
    image: drupal
    labels:
      - "traefik.http.routers.drupal.rule=Host(`drupal.localhost`)"

I kind of feel stupid to have miss this one... But thanks for pointing the issue :slight_smile: