Activating cloudlfare plugin results in error

While setting up traefik on my synology using docker and cloudflare tunnels, i have now everything working, but i want to be able to rewrite the CF headers into the headers of the receiving http application, in this case whoami. This to have the proper public ip's in the access logs.

So far in all my tries i get the error
middleware "cloudflare@file" does not exist

I have tried finding information on how to setup the plugins via docker-compose files, but it seems i am missing something.

My docker-compose for traefik looks like this (only sharing relevant lines) :

services:
  reverse-proxy:
    # The official v3 Traefik docker image
    image: traefik:v3.3
    container_name: "traefik"
    # Enables the web UI and tells Traefik to listen to docker
    command:
      #setup TLS for https

      - "--entrypoints.https.address=:443"
      - "--entrypoints.https.http.tls=true"
      - "--entrypoints.https.http.tls.certresolver=letsencrypt"
      - "--entrypoints.https.http.tls.domains[0].main=${ROOT_DOMAIN}"
      - "--entrypoints.https.http.tls.domains[0].sans=*.${ROOT_DOMAIN}"

      # Server Transport
      - "--serversTransport.insecureSkipVerify=true" # Allow self-signed certificates for target hosts - https://doc.traefik.io/traefik/routing/overview/#insecureskipverify

      # define plugins
      - "--experimental.plugins.cloudflare.modulename=github.com/Desuuuu/traefik-cloudflare-plugin"
      - "--experimental.plugins.cloudflare.version=v1.0.0"

      # define dynamic configuration file
      - "--providers.file.filename=/config/dynamic.yml"
      - "--providers.file.watch=true"
      - "--providers.file.directory=/config"

  volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock
      - /volume1/docker/traefik/logs:/logs
      - /volume1/docker/traefik/acme:/etc/traefik/acme
      - /volume1/docker/traefik/config:/config
      - /volume1/docker/traefik/config/dynamic.yml:/config/dynamic.yml
      - /volume1/docker/traefik/letsencrypt:/letsencrypt

whoami dockercompose 

    labels: 
    - "traefik.enable=true"
      - "traefik.docker.network=traefik"  
      - "traefik.http.routers.whoami.rule=Host(`whoami.xxx`)"
      - "traefik.http.routers.whoami.entrypoints=https"
     - "traefik.http.routers.whoami.tls=true"
      - "traefik.http.routers.whoami.tls.certresolver=letsencrypt"
      - "traefik.http.routers.whoami.middlewares=cloudflare@file"
      - "traefik.constraint=proxy-public"

Then i have the following file configured dynamic.yml

http:
  middlewares:
    cloudflare:
      plugin:
        cloudflare:
          # plugin options here, see plugin docs for details
          realIpHeader: "CF-Connecting-IP"

after more testing it seems my traefik docker did not restart , therefore the plugin did not exist as it was not downloaded yet, casuing this issue. So the config presented should be enough to get an plugin working.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.