Skip to content

Instantly share code, notes, and snippets.

@javaadpatel
Created March 28, 2020 09:32
Show Gist options
  • Save javaadpatel/eeb43a2950d5c8abdd4f1ae309630410 to your computer and use it in GitHub Desktop.
Save javaadpatel/eeb43a2950d5c8abdd4f1ae309630410 to your computer and use it in GitHub Desktop.
Traefik dashboard routing and authentication middleware configuration (repository: https://github.com/javaadpatel/Medium_Securing_Traefik_Dashboard)
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-dashboard
spec:
entryPoints:
- web
- websecure
routes:
- match: Host(`traefik.YOURDOMAIN.com`)
kind: Rule
services:
- name: api@internal
kind: TraefikService
middlewares:
- name: auth
tls:
certResolver: le
domains:
- main: YOURDOMAIN.com
sans:
- "*.YOURDOMAIN.com"
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: auth
spec:
forwardAuth:
address: https://traefikauth.YOURDOMAIN.com/_oauth
trustForwardHeader: true
authResponseHeaders:
- X-Forwarded-User
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment