Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

426
Vistas
ForwardAuth Middleware is not working in Traefik as API Gateway

I am trying to run Traefik as an API gateway and want to trigger ForwardAuth middleware by using the following docker compose file but the middleware the auth endpoint is not being hit. I am using it with localhost.

version: '3'

services:
  reverse-proxy:
    image: traefik # The official Traefik docker image
    command: --api --docker # Enables the web UI and tells Traefik to listen to docker
    ports:
      - "80:80"     # The HTTP port
      - "8080:8080" # The Web UI (enabled by --api)
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
      - $PWD/traefik.toml:/traefik.toml     

  whoami:
    image: emilevauge/whoami
    labels:
      - traefik.enable=true
      - "traefik.frontend.rule=Host:whoami.docker.localhost"
      - "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
      - "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
      - "traefik.http.middlewares.testauth.ForwardAuth.Address=http://localhost:55391/api/Auth"
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I was struggling with this for a while as well, and couldn't find an answer anywhere other than fairly hidden in the Traefik docs. The ForwardAuth docs don't actually mention this, but looking at the middlewares overview configuration example I suddenly noticed that you not only have to specify the middleware, you also have to apply it to the router.

Adding this label to whoami service should do the trick:

- "traefik.http.routers.whoami.middlewares=testauth"

Note that you can also specify multiple middlewares here, by comma-separating them, so you could add the other middlewares you defined like so:

- "traefik.http.routers.whoami.middlewares=testauth,test-redirectscheme,test-replacepath"
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda