apiVersion: v1
kind: Namespace
metadata:
  name: traefik-middlewares
  namespace: traefik-middlewares
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: compress
  namespace: traefik-middlewares
spec:
  compress: {}
---
# Here, an average of 300 requests per second is allowed.
# In addition, a burst of 200 requests is allowed.
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: basic-ratelimit
  namespace: traefik-middlewares
spec:
  rateLimit:
    average: 300
    burst: 200
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: basic-secure-headers
  namespace: traefik-middlewares
spec:
  headers:
    accessControlAllowMethods:
      - GET
      - OPTIONS
      - HEAD
      - PUT
    accessControlMaxAge: 100
    # sslRedirect: true
    # stsSeconds: 63072000
    # stsIncludeSubdomains: false
    # stsPreload: false
    # forceSTSHeader: true
    contentTypeNosniff: true
    browserXssFilter: true
    sslForceHost: true
    referrerPolicy: same-origin
    customResponseHeaders:
      X-Robots-Tag: 'none'
      server: ''
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: bouncer
  namespace: traefik-middlewares
spec:
  redirectRegex:
    regex: .*
    replacement: 'https://auth.test.org/'

---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: chain-public
  namespace: traefik-middlewares
spec:
  chain:
    middlewares:
    - name: basic-ratelimit
    - name: basic-secure-headers
    - name: compress
