Traefik not passing through custom header

I have a simple traefik proxy configuration using labels:

  • "traefik.enable=true"
  • "traefik.http.routers.service-name.rule=Host(host.name.com)"
  • "traefik.http.routers.service-name.entrypoints=web"
  • "traefik.http.services.service-name.loadbalancer.server.port=8680"
  • "traefik.http.routers.service-name.service=service-name"

The service requires a custom header that does not start with an X. When I try to access the service through traefik it does not pass the header to the service.

You need to define middlewares for your service.
Read documentation here

Example for adding a custom SSL head:

  • "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
  • "traefik.http.routers.service-name.middlewares=sslheader"