Tweaking the RequestAttached to routers, pieces of middleware are a means of tweaking requests before they are sent to your service (or before the answer from the services are sent to the clients).There are several available middleware in Traefik. Some can modify the request, the headers, some are in charge of redirections, some add authentication, and so on.Middlewares that use the same protocol can be combined into chains to fit every scenario.
Provider NamespaceBe aware of the concept of Providers Namespace. It also applies to Middlewares.
# As a Docker Labelwhoami: # A container that exposes an API to show its IP address image: traefik/whoami labels: # Create a middleware named `foo-add-prefix` - "traefik.http.middlewares.foo-add-prefix.addprefix.prefix=/foo" # Apply the middleware named `foo-add-prefix` to the router named `router1` - "traefik.http.routers.router1.middlewares=foo-add-prefix@docker"