404 when switching from containerized Traefik to running Traefik on the host

When I run traefik containerized, it correctly forwards traffic to my Docker containers and sets up routing just fine based on the labels. However, recently I've needed to route to processes running on the host system, and I thought that hoisting Traefik to run on the host system as well would be the easiest solution, and that turning on the docker provider should just "keep working". However, when I visit routes in a browser or use curl, I get 404s.

Does Traefik support routing to multiple providers?: processes on the host and Docker containers?

Thanks in advance.


accessLog: true

    address: ":80"
    address: ":443"

      email: MY_EMAIL
      storage: /opt/traefik/data/traefik-acme.json
        entryPoint: web

    network: traefik
    watch: true
    filename: /etc/traefik/dynamic_config.yaml # currently an empty file until I can get the Docker routing working
    watch: true

Ansible docker_container spec:

- name: Start Jellyfin
    name: jellyfin
    image: jellyfin/jellyfin
    restart_policy: unless-stopped
    container_default_behavior: no_defaults
      traefik.enable: "true"
      traefik.docker.network: traefik
      traefik.http.services.jellyfin-web.loadbalancer.server.port: "8096"
      # Middlewares:
      traefik.http.middlewares.jellyfin-redirect-tls.redirectscheme.scheme: "https"
      traefik.http.middlewares.jellyfin-redirect-tls.redirectscheme.permanent: "true"
      # HTTP:
      traefik.http.routers.jellyfin-web.rule: "Host(`example.com`)"
      traefik.http.routers.jellyfin-web.middlewares: "jellyfin-redirect-tls"
      traefik.http.routers.jellyfin-web.entrypoints: "web"
      # HTTPS:
      traefik.http.routers.jellyfin-web-secure.rule: "Host(`example.com`)"
      traefik.http.routers.jellyfin-web-secure.tls: "true"
      traefik.http.routers.jellyfin-web-secure.tls.certresolver: "letsencrypt"
      traefik.http.routers.jellyfin-web-secure.entrypoints: "web-secure"
     - name: traefik
      - ...SNIP...

You can actually just use the one traefik instance running as a docker container to route to host services.
Just Type docker network inspect traefik And use the ip of the gateway for a new service that routs to the host.

For example:

If you have a service running on (so on localhost port 80 on the host) than you can route to that with traefik running inside docker by writing a router with a service that uses the following url: http://[gateway-ip-of-traefik-network]:80.

If you still need help with how to actually write that config let me know.

Best of Luck :slight_smile:

I actually got this working after stopping the Docker-Traefik and just running the other Traefik on the right ports (80/443). I think it was getting hung up at the ACME part or something (I have no idea how the internals work), but it appears that the internals were not fully started, and so it was returning 404 for everything. Once it was running on the correct ports, everything behaved as expected.

This issue was what tipped me off: Getting 401 or 404 HTTP errors for every service