# creating new middleware

**URL:** <https://community.traefik.io/t/creating-new-middleware/29345>\
**Category:** Traefik v3 (latest)\
**Tags:** docker\
**Created:** [November 24, 2025, 6:59am UTC](https://community.traefik.io/t/creating-new-middleware/29345 "2025-11-24T06:59:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamadrezamomeni](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/mohamadrezamomeni/32/10917_2.png) [@mohamadrezamomeni](https://community.traefik.io/u/mohamadrezamomeni)\
**Post date:** [November 24, 2025, 6:59am UTC](https://community.traefik.io/t/creating-new-middleware/29345/1 "2025-11-24T06:59:27Z")

</div>

i’m new to traefik i want to test that before useing in production i publish custom middleware like plugindemo [GitHub - mohamadrezamomeni/mamad](https://github.com/mohamadrezamomeni/mamad) but when i use it i got time="2025-11-23T18:57:45Z" level=error msg="Plugins are disabled because an error has occurred." error="unable to set up plugins environment: unable to download plugin [github.com/mohamadrezamomeni/mamad:](http://github.com/mohamadrezamomeni/mamad:) error: 404: {"error":"Unknown plugin: [github.com/mohamadrezamomeni/mamad@v0.4.0"}"](http://github.com/mohamadrezamomeni/mamad@v0.4.0%22%7D%22)

traefik yaml is api:

dashboard: true

insecure: false

entryPoints:

web:

```
address: ":80"

```

dashboard:

```
address: ":8080"

```

providers:

docker:

```
endpoint: "unix:///var/run/docker.sock"

exposedByDefault: false

```

file:

```
filename: "/etc/traefik/dynamic.yml"

```

experimental:

plugins:

```
example:

  moduleName: github.com/mohamadrezamomeni/mamad

  version: v0.4.0

```

and dynmic yml is http:

routers:

```
dashboard:

  entryPoints:

    - dashboard

  rule: Host(\`localhost\`) && (PathPrefix(\`/dashboard\`) || PathPrefix(\`/api\`))

  service: api@internal

  middlewares:

    - my-plugin

```

middlewares:

```
my-plugin:

  plugin:

    example:

      headers:

        Foo: Bar

```

docker compose is

version: "3"

services:

traefik:

```
image: traefik:v2

container_name: traefik

restart: always

ports:

  - "80:80"

  - "8080:8080"

volumes:

  - /var/run/docker.sock:/var/run/docker.sock:ro

  - ./traefik.yml:/etc/traefik/traefik.yml:ro

  - ./dynamic.yml:/etc/traefik/dynamic.yml:ro # FIXED

  \# - ./plugins:/plugins:ro

environment:

  - TZ=UTC

command:

  - "--log.level=INFO"

```

whoami:

```
image: containous/whoami

container_name: whoami

labels:

  - "traefik.enable=true"

  - "traefik.http.routers.whoami.entryPoints=web"

  - "traefik.http.routers.whoami.rule=Host(\`whoami.localhost\`)"

```

networks:

default:

```
name: traefik-net

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [November 24, 2025, 7:01am UTC](https://community.traefik.io/t/creating-new-middleware/29345/2 "2025-11-24T07:01:59Z")

</div>

Please format your code using 3 backticks.

---

<div class="post-metadata">

**Author:** ![mohamadrezamomeni](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/mohamadrezamomeni/32/10917_2.png) [@mohamadrezamomeni](https://community.traefik.io/u/mohamadrezamomeni)\
**Post date:** [November 24, 2025, 8:01am UTC](https://community.traefik.io/t/creating-new-middleware/29345/3 "2025-11-24T08:01:30Z")

</div>

this is my repo this is for test why it hasn’t been published 🙁

> **[GitHub - mohamadrezamomeni/mamad at v0.1.0](https://github.com/mohamadrezamomeni/mamad/tree/v0.1.0)**
>
> v0.1.0

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [November 24, 2025, 8:36am UTC](https://community.traefik.io/t/creating-new-middleware/29345/4 "2025-11-24T08:36:09Z")

</div>

Please format your config using 3 backticks.
