@@ -0,0 +1,57 @@
1+http:
2+ routers:
3+ oauth2-proxy-route:
4+ rule: "Host(`oauth2-proxy.oauth2-proxy.localhost`)"
5+ middlewares:
6+ - auth-headers
7+ service: oauth-backend
8+ httpbin-route:
9+ rule: "Host(`httpbin.oauth2-proxy.localhost`)"
10+ service: httpbin-service
11+ middlewares:
12+ - oauth-auth-redirect # redirects all unauthenticated to oauth2 signin
13+ httpbin-route-2:
14+ rule: "Host(`httpbin.oauth2-proxy.localhost`) && PathPrefix(`/no-auto-redirect`)"
15+ service: httpbin-service
16+ middlewares:
17+ - oauth-auth-wo-redirect # unauthenticated session will return a 401
18+ services-oauth2-route:
19+ rule: "Host(`httpbin.oauth2-proxy.localhost`) && PathPrefix(`/oauth2/`)"
20+ middlewares:
21+ - auth-headers
22+ service: oauth-backend
23+
24+ services:
25+ httpbin-service:
26+ loadBalancer:
27+ servers:
28+ - url: http://httpbin
29+ oauth-backend:
30+ loadBalancer:
31+ servers:
32+ - url: http://oauth2-proxy:4180
33+
34+ middlewares:
35+ auth-headers:
36+ headers:
37+ stsSeconds: 315360000
38+ browserXssFilter: true
39+ contentTypeNosniff: true
40+ forceSTSHeader: true
41+ stsIncludeSubdomains: true
42+ stsPreload: true
43+ frameDeny: true
44+ oauth-auth-redirect:
45+ forwardAuth:
46+ address: http://oauth2-proxy:4180
47+ trustForwardHeader: true
48+ authResponseHeaders:
49+ - X-Auth-Request-Access-Token
50+ - Authorization
51+ oauth-auth-wo-redirect:
52+ forwardAuth:
53+ address: http://oauth2-proxy:4180/oauth2/auth
54+ trustForwardHeader: true
55+ authResponseHeaders:
56+ - X-Auth-Request-Access-Token
57+ - Authorization