Combining dynamic configuration providers

Hello, community. I just started with traefik, stumbled upon a problem and I have a few questions:

  1. Is it possible to combine different providers? I want to use the docker provider as well as have some dynamic configuration in a file.
  2. Does the order in which I specify the providers matter?
  3. If I specify a file provider of directory type, can I mix dynamic configurations in .yaml and .toml? Will traefik pick up all of them from the specified directory?

The problem: I'm trying to run Nextcloud behind traefik and I'm struggling. In their guide, they are explicitly warning that:

Please note: Since the Apache container gets spawned by the mastercontainer, there is NO way to provide custom docker labels or custom environmental variables for the Apache container. So please do not attempt to do this because you will fail! Only the documented way will work!

Further in the guide there is a dynamic configuration in toml. All of my other services behind traefik are autodiscovered by using lables and the the docker provider. However when I specify both (docker and file providers) the middlewares and routers from the file never get created.

This is what my directory looks like:

This is how my traefik.yml configuration looks like:

    endpoint: "unix:///var/run/docker.sock"
    watch: true
    #exposedByDefault: false
    network: proxy
    directory: "/configs"
    watch: true

This is how the nextcloud.toml dynamic config looks like:

        entryPoints = ["https"]
        rule = "Host("
        service = "nc-svc"
        middlewares = ["chain-no-auth"]
            certresolver = "le"

            passHostHeader = true
                url = ""

        hostsProxyHeaders = ["X-Forwarded-Host"]
        sslRedirect = true
        referrerPolicy = "same-origin"
        X-Robots-Tag = "none"

        middlewares = [ "middlewares-rate-limit", "nc-middlewares-secure-headers"]

I'm also mounting the entire "configs" directory like so:

      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /srv/traefik/data/traefik.yml:/traefik.yml:ro
      - /srv/traefik/data/acme.json:/acme.json
      - /srv/traefik/configs/nextcloud.toml:/configs/nextcloud.toml:ro

Upon spinning up traefik with docker-compose, it seems that it never picks up the configuration and does not create the nc-rtr router, nor the nc-middlewares-secure-headers middleware.

Both of these commands return nothing:

docker logs traefik | grep @file
docker logs traefik | grep nc-

I will be very grateful if you could help me diagnose the problem. Thank you in advance

Mixing Docker and File works for us. Dynamic config for services we usually place within their Docker labels.

Host( is missing backticks, see docs, maybe that is the issue.

Hi, bluepuma, thank you for taking the time to respond and for the clarification.
The backticks fixed the issue.