Chain Middlewares
The chain middleware enables you to define reusable combinations of other pieces of middleware. It makes it effortless to reuse the same groups.
Below is an example of a chain containing:
- Chain Middleware
- Middlewares to chain
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: secured
namespace: apps
spec:
chain:
middlewares:
- name: https-only
- name: known-ips
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: https-only
spec:
redirectScheme:
scheme: https
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: known-ips
spec:
ipAllowList:
sourceRange:
- 192.168.1.7
- 127.0.0.1/32
Configuration Options
Field | Description | Default | Required |
---|---|---|---|
middlewares | List of middlewares to chain. The middlewares have to be in the same namespace as the chain middleware. | Yes |