# Header Not reachning backend

**URL:** <https://community.traefik.io/t/header-not-reachning-backend/29711>\
**Category:** Traefik v3 (latest)\
**Tags:** file, middleware\
**Created:** [February 28, 2026, 6:32am UTC](https://community.traefik.io/t/header-not-reachning-backend/29711 "2026-02-28T06:32:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ojordano](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ojordano/32/11119_2.png) [@ojordano](https://community.traefik.io/u/ojordano)\
**Post date:** [February 28, 2026, 6:32am UTC](https://community.traefik.io/t/header-not-reachning-backend/29711/1 "2026-02-28T06:32:28Z")

</div>

Hello.

I am at the moment hosting a Traefik container and backend container in Scaleway.

To access containers in Scaleway while they are in private mode, a token must be passed to request header. In postman i use the token to first reach Traefik container and I used middlewares headers to have the token passed to the backend from traefik. But this is not working. Does anyone please have a clue for me ??

Below is my configuration :

> ````auto
> ```
> api:
> insecure: false
> dashboard: true
> 
> providers:
> file:
> filename: /etc/traefik/traefik.yaml
> 
> entryPoints:
> web:
> address: ":8080" # The port my traefik container is listening
> 
> log:
> level: DEBUG
> 
> http:
> routers:
> auth-router:
> rule: "Host(`entry.path.io`) && PathPrefix(`/api/v1/`)"
> entryPoints:
> - web
> service: auth-service
> middlewares:
> - security-headers
> 
> middlewares:
> security-headers:
> headers:
> customRequestHeaders:
> X-Auth-Token: xxxxx-something-aaaa-bbbbb-mm
> 
> services:
> auth-service:
> loadBalancer:
> passHostHeader: false
> servers:
> - url: "https://target.path.io"
> ```
> 
> ````

As container are in private mode The scenario is supposed to be :

- I do a **GET** in postman to [entry.path.io/api/v1](http://entry.path.io/api/v1) and in header tab i put X-Auth-Token: xxxxx-something-aaaa-bbbbb-mm

- The request will be redirected to [https://target.path.io](https://target.path.io) and as stated in the yaml file, it will add itself again the header X-Auth-Token: xxxxx-something-aaaa-bbbbb-mm , because target container is also in private mode. `(This is what is not working ` ☹` ` ☹`. Because when i pass this backend container to public, it works konwing that my Traefik container is still in private (1st step). It Means traefik is not being able to question the backend adding the header token)`

I would appreciate any advice to have this working.

Thank you

---

<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:** [February 28, 2026, 6:34am UTC](https://community.traefik.io/t/header-not-reachning-backend/29711/2 "2026-02-28T06:34:06Z")

</div>

Use 3 backticks before and after code/config to make it more readable and preserve spacing, which is important in yaml.

---

<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:** [February 28, 2026, 10:09am UTC](https://community.traefik.io/t/header-not-reachning-backend/29711/3 "2026-02-28T10:09:24Z")

</div>

`customrequestheaders` is working for me, it is echoed back by whoami:

```auto
services:
  whoami:
    image: traefik/whoami:v1.10
    networks:
      - proxy
    labels:
      - traefik.enable=true
      - traefik.http.routers.whoami.rule=Host(`whoami.example.com`)
      - traefik.http.middlewares.myRequestHeader.headers.customrequestheaders.X-myRequestHeader=FOO
      - traefik.http.middlewares.myResponseHeader.headers.customresponseheaders.X-myResponseHeader=BAR
      - traefik.http.routers.whoami.middlewares=myRequestHeader,myResponseHeader
      - traefik.http.services.whoami.loadbalancer.server.port=80
      - traefik.http.services.whoami.loadbalancer.passHostHeader=false

```

---

<div class="post-metadata">

**Author:** ![ojordano](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ojordano/32/11119_2.png) [@ojordano](https://community.traefik.io/u/ojordano)\
**Post date:** [February 28, 2026, 7:03pm UTC](https://community.traefik.io/t/header-not-reachning-backend/29711/4 "2026-02-28T19:03:36Z")

</div>

Hello @bluepuma77 ; Thank you very much for your help

So after testing with the whoami, I realised it was a prefix handing to the backend error.

I had to add in middelware striper option as well to have path as clean as possible.

````auto
```
  middlewares:

   auth-striper:
      stripPrefix:
        prefixes:
          - "/auth-service/"
```

````

We retested and all is fine in private mode, end to end

Thank you for your reaction.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [March 3, 2026, 7:03pm UTC](https://community.traefik.io/t/header-not-reachning-backend/29711/5 "2026-03-03T19:03:46Z")

</div>

Closed on March 3, 2026, 7:03pm UTC

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