Created
March 28, 2020 09:32
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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