-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynamic_conf.yml
55 lines (50 loc) · 1.54 KB
/
dynamic_conf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
http:
routers:
my-api:
entryPoints:
# Expose on :8080 aka 'dashboard'
- dashboard
# Activate this Router if Client asks for '/dashboard' or '/api'
rule: "PathPrefix(`/dashboard`) || PathPrefix(`/api`)"
# Expose the API
service: api@internal
# Use basic auth Middleware define below
middlewares:
- dashboard-auth
my-secure-api:
entryPoints:
# Expose via https
- https
# Activate this Router if Client requests specific subdomain and '/dashboard' or '/api'
rule: "Host(`dashboard.traefik.coolguys.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
service: api@internal
middlewares:
- dashboard-auth
tls:
# Use ACME HTTP Challgen defined in 'traefik.yml' to get valid cert
certResolver: myhttpchallenge
# Catch all global Router for redirects
https-redirect:
entryPoints:
- http
# Activate this Router on any Host requested
rule: "hostregexp(`{host:.+}`)"
# A service definition is mandatory that's why we use a dummy service define at the bottom
service: dummy
middlewares:
- redirect-to-https
middlewares:
dashboard-auth:
basicAuth:
users:
# admin:passw0rd
- "admin:$2y$05$kqK7GlhnGCnt/fYdrCL2AeZykK2T0cN4sBcCaRs61vMz7yMWaR9M."
redirect-to-https:
redirectScheme:
scheme: https
permanent: true
services:
dummy:
loadBalancer:
servers:
- url: localhost