Need help on reverse proxying to another server behind same IP


I have 2 servers behind the same IP address and I'm trying to get Traefik hosted on one server to point to the other server when a specific subdomain is used.

I've followed the Digital Ocean guide here to setting up Traefik and have searched and found some others with the same issue as me.

However, even after reading replies to their posts, I can't figure out what I'm doing wrong and when I modify my traefik_dynamic.toml file, not only does the subdomain not point to the other server, the traefik subdomain results in a 404s.

Could any kind soul please point me in the right direction? Do I need 2 files for definition of 2 subdomains?

Here's what my traefik_dynamic.toml looks like

      rule = "Host(` domain`)"
      entrypoints = ["websecure"]
      middlewares = ["simpleAuth"]
      service = "api@internal"
        certResolver = "lets-encrypt"

      rule = "Host(` domain`)"
      entrypoints = ["websecure"]
      service = "foo"
        certResolver = "lets-encrypt"
        servers = ""


i'm no big fan of the toml notation, but shouldn't it be


instead of


Maybe this post could also be helpful: