HTTP Middleware Overview
Configuration Example
# As a Kubernetes Traefik IngressRoute
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: stripprefix
spec:
stripPrefix:
prefixes:
- /stripit
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: ingressroute
spec:
# more fields...
routes:
# more fields...
middlewares:
- name: stripprefix
Available HTTP Middlewares
📄️ AddPrefix
Learn how to implement the HTTP AddPrefix middleware in Traefik Hub to update request paths before being forwarded.
📄️ API Key Authentication
Traefik Hub - API Key authentication middleware.
📄️ BasicAuth
The HTTP basic authentication (BasicAuth) middleware in Traefik Hub restricts access to Services to known users.
📄️ Buffering
The HTTP buffering middleware in Traefik Hub limits the size of requests that can be forwarded to Services.
📄️ Chain
The HTTP chain middleware lets you define reusable combinations of other middleware, to reuse the same groups.
📄️ CircuitBreaker
The HTTP circuit breaker prevents stacking requests to unhealthy Services, resulting in cascading failures.
📄️ Compress
The compress middleware lets you compress responses before sending them to the client.
📄️ ContentType
Traefik Hub's HTTP middleware automatically sets the `Content-Type` header value when it is not set by the backend.
📄️ DigestAuth
HTTP DigestAuth middleware restricts access to your services to known users.
📄️ Distributed RateLimit
HTTP RateLimit middleware ensures Services receive fair amounts of requests throughout your cluster and not only on an individual proxy
📄️ Error Pages
The Errors middleware returns custom pages according to configured ranges of HTTP Status codes.
📄️ ForwardAuth
The HTTP ForwardAuth middleware delegates authentication to an external Service.
📄️ GrpcWeb
GrpcWeb converts a gRPC Web requests to HTTP/2 gRPC requests.
📄️ Headers
The HTTP headers middleware manages the headers of requests and responses.
📄️ InFlightReq
The InFlightReq HTTP middleware lets you limit the number of simultaneous in-flight requests.
📄️ IPAllowList
Learn how to use IPAllowList in HTTP middleware for limiting clients to specific IPs.
📄️ JWT Authentication
Traefik Hub - Learn how to configure the JWT Authentication middleware for Ingress management.
📄️ OAuth 2.0 Client Credentials Authentication
The OAuth 2.0 Client Credentials Authentication middleware secures your applications using the client credentials flow
📄️ OAuth 2.0 Token Introspection Authentication
Traefik Hub - OAuth 2.0 Token Introspection allows to retrieve metadata about an access token from an OAuth 2.0 server.
📄️ OpenID Connect Authentication
Traefik Hub - The OIDC Authentication middleware secures your applications by delegating the authentication to an external provider.
📄️ PassTLSClientCert
The PassTLSClientCert adds selected data from passed client TLS certificates to headers.
📄️ RateLimit
HTTP RateLimit middleware ensures Services receive fair amounts of requests
📄️ RedirectRegex
RedirectRegex redirecting clients to different locations.
📄️ RedirectScheme
RedirectScheme redirects clients to different schemes/ports.
📄️ ReplacePath
ReplacePath updates paths before forwarding requests.
📄️ ReplacePathRegex
ReplacePathRegex updates paths before forwarding requests, using a regex.
📄️ Retry
Retry requests to a backend server until it succeeds.
📄️ StripPrefix
StripPrefix removes prefixes from paths before forwarding requests.
📄️ StripPrefixRegex
StripPrefixRegex removes prefixes from paths before forwarding requests, using regex. Read the technical documentation.
Community Middlewares
Please take a look at the community-contributed plugins in the plugin catalog.