Getting 404 on particular subdomain, when serving multiple subdomains

Hi community, been using Traefik v2.0 since early this year while it was in beta but I all of a sudden started hitting an issue when adding a second subdomain.

I have:

  • sub1.domain.com A record pointing to IP1 address
  • *.sub1.domain.com CNAME record pointing to sub1.domain.com
  • sub2.domain.com A record pointing to IP1 address
  • domain.com A record pointing to IP2 address
  • www.domain.com CNAME record pointing to domain.com

domain.com and www.domain.com working :ok_hand:

I have a host of docker hosted containers dynamically being routed via *.sub1.domain.com but then I just have a single container hosting sub2.domain.com.

This worked for sometime but all of a sudden has now quit.

The label on the sub2 container looks like this:

- "traefik.http.routers.container_service.rule=Host(`sub2.domain.com`)"

I have some secure-headers being added to Traefik respones which I'm seeing when I try to curl sub2.domain.com but for some reason the requests are not being routed to the container.

Furthermore, via the Traefik dashboard API, I can see the router for this service properly pointing to the service. It's totally identical to other services which are working.

Everything seems to be pointing to either my DNS set up or something to do with subdomains vs subdomains of a subdomain. Any thoughts?

Edit -- found this in the Traefik logs:

traefik                 | time="2019-10-14T15:23:05Z" level=error msg="unable to find the IP address for the container \"/container_service\": the server is ignored" providerName=docker container=container_service-docker-80f86f2069d5d9086eb63c94d3a01810a4b5c96962ef1cedb95c97fbb5caccbb

Dalan,
Have you made any progress with this problem? I have similar trouble. I have multiple web sites that I would like to access using sub1.domain, sub2.domain, etc... I am getting the same results in Chrome and Edge. I will always have a single sub domain functional while the others return 404. It seems to have something to do with cookies but incognito windows do not seem to make a difference.

Hello Aaron, if you do not have

in your log, you are most definitely not having the same issue.

In any case I think that your issue is caused by a mistake in the configuration.

Yes, I did manage to get everything working just fine in the end. It took a bit of fiddling though and now nearly a year later I can't recall what I did to make it work. I can post some of my config though if that would be helpful? I'm completely confident that you can make your set up work though.