2025-03-10 15:28:06 +01:00

4.3 KiB

title description
Traefik Proxy Middleware Overview There are several available middleware in Traefik Proxy used to modify requests or headers, take charge of redirections, add authentication, and so on.

HTTP Middleware Overview

Attached to the routers, pieces of middleware are a means of tweaking the requests before they are sent to your service (or before the answer from the services are sent to the clients).

There are several available middlewares 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.

!!! warning "Provider Namespace"

Be aware of the concept of Providers Namespace described in the [Configuration Discovery](../../../install-configuration/providers/overview.md#provider-namespace) section.
It also applies to Middlewares.

Available HTTP Middlewares

Middleware Purpose Area
AddPrefix Adds a Path Prefix Path Modifier
BasicAuth Adds Basic Authentication Security, Authentication
Buffering Buffers the request/response Request Lifecycle
Chain Combines multiple pieces of middleware Misc
CircuitBreaker Prevents calling unhealthy services Request Lifecycle
Compress Compresses the response Content Modifier
ContentType Handles Content-Type auto-detection Misc
DigestAuth Adds Digest Authentication Security, Authentication
Errors Defines custom error pages Request Lifecycle
ForwardAuth Delegates Authentication Security, Authentication
GrpcWeb Converts gRPC Web requests to HTTP/2 gRPC requests. Request
Headers Adds / Updates headers Security
IPAllowList Limits the allowed client IPs Security, Request lifecycle
InFlightReq Limits the number of simultaneous connections Security, Request lifecycle
PassTLSClientCert Adds Client Certificates in a Header Security
RateLimit Limits the call frequency Security, Request lifecycle
RedirectScheme Redirects based on scheme Request lifecycle
RedirectRegex Redirects based on regex Request lifecycle
ReplacePath Changes the path of the request Path Modifier
ReplacePathRegex Changes the path of the request Path Modifier
Retry Automatically retries in case of error Request lifecycle
StripPrefix Changes the path of the request Path Modifier
StripPrefixRegex Changes the path of the request Path Modifier

Community Middlewares

Please take a look at the community-contributed plugins in the plugin catalog.

{!traefik-for-business-applications.md!}