Skip to content

Commit 84ba514

Browse files
committed
change conf file format to toml
1 parent e92b6ce commit 84ba514

File tree

6 files changed

+130
-77
lines changed

6 files changed

+130
-77
lines changed

traefik/conf/default.toml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[http.middlewares]
2+
[http.middlewares.basic-auth.basicAuth]
3+
users = ["benson:$apr1$5HP.kZpz$cvmDw3ADcLwSAzNDLF8RZ."]
4+
removeHeader = true
5+
[http.middlewares.https-redirect.redirectScheme]
6+
scheme = "https"
7+
permanent = true
8+
port = 5443
9+
[http.middlewares.content-compress.compress]
10+
11+
# tricks 实现,提供 HTTP 默认转发 HTTPS
12+
# https://github.com/containous/traefik/issues/4863#issuecomment-491093096
13+
# [http.services]
14+
# [http.services.noop.LoadBalancer]
15+
# [[http.services.noop.LoadBalancer.servers]]
16+
# url = "" # or url = "localhost"
17+
# [http.routers]
18+
# [http.routers.https-redirect]
19+
# entryPoints = ["http"]
20+
# rule = "HostRegexp(`{any:.*}`)"
21+
# middlewares = ["https-redirect"]
22+
# service = "noop"
23+
24+
25+
# [[tls.certificates]]
26+
# certFile = "/data/ssl/bensonfx.net.crt"
27+
# keyFile = "/data/ssl/bensonfx.net.key"
28+
# stores = ["default"]
29+
30+
[tls.options]
31+
[tls.options.default]
32+
minVersion = "VersionTLS12"
33+
sniStrict = true
34+
preferServerCipherSuites = true
35+
cipherSuites = [
36+
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
37+
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
38+
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
39+
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
40+
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305",
41+
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305",
42+
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
43+
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
44+
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
45+
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
46+
"TLS_RSA_WITH_AES_128_GCM_SHA256",
47+
"TLS_RSA_WITH_AES_256_GCM_SHA384",
48+
"TLS_RSA_WITH_AES_128_CBC_SHA",
49+
"TLS_RSA_WITH_AES_256_CBC_SHA",
50+
]
51+
[tls.options.mintls13]
52+
minVersion = "VersionTLS13"

traefik/conf/default.yml

-53
This file was deleted.

traefik/conf/nas.toml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[http.services]
2+
[http.services.dsphoto.loadBalancer]
3+
passHostHeader = true
4+
[[http.services.dsphoto.loadBalancer.servers]]
5+
url = "http://photo.example.com"
6+
[http.services.nas.loadBalancer]
7+
passHostHeader = true
8+
[[http.services.nas.loadBalancer.servers]]
9+
url = "http://nas.example.com:5000"
10+
11+
[http.routers]
12+
[http.routers.dsphoto]
13+
entryPoints = ["https"]
14+
rule = "Host(`photo.example.com`)"
15+
service = "dsphoto"
16+
[http.routers.dsphoto.tls]
17+
[http.routers.nas]
18+
entryPoints = ["https"]
19+
rule = "Host(`nas.example.com`)"
20+
service = "nas"
21+
[http.routers.nas.tls]

traefik/conf/nas.yml

-23
This file was deleted.

traefik/docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- "--global.sendanonymoususage=false"
1111
- "--global.checknewversion=false"
1212
- "--api.dashboard=true"
13+
# - "--api.insecure=true"
1314
# - "--api.debug=true"
1415
- "--ping=true"
1516
- "--entrypoints.http.address=:80"
@@ -35,8 +36,8 @@ services:
3536
- "--providers.docker.network=traefik"
3637
- "--providers.docker.swarmMode=false"
3738
- "--providers.file=true"
39+
- "--providers.file.watch=true"
3840
- "--providers.file.directory=/etc/traefik/conf"
39-
- "--providers.file.debugloggeneratedtemplate=true"
4041
4142
- "--certificatesresolvers.le.acme.storage=/data/ssl/acme.json"
4243
- "--certificatesresolvers.le.acme.keytype=EC256"

traefik/traefik.toml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[global]
2+
checkNewVersion = false
3+
sendAnonymousUsage = false
4+
[log]
5+
# level = "DEBUG"
6+
filePath = "/logs/traefik.log"
7+
format = "json"
8+
[accessLog]
9+
filePath = "/logs/access.log"
10+
format = "json"
11+
[api]
12+
dashboard = true
13+
# insecure = true
14+
[ping]
15+
16+
[entryPoints]
17+
[entryPoints.http]
18+
address = ":80"
19+
[entryPoints.http.forwardedHeaders]
20+
trustedIPs = ["127.0.0.1/32", "172.18.0.0/24", "192.168.31.0/24"]
21+
[entryPoints.http.http.redirections]
22+
[entryPoints.http.http.redirections.entryPoint]
23+
to = "https"
24+
scheme = "https"
25+
[entryPoints.https]
26+
address = ":443"
27+
[entryPoints.https.forwardedHeaders]
28+
trustedIPs = ["127.0.0.1/32", "172.18.0.0/24", "192.168.31.0/24"]
29+
[entryPoints.https.http.tls]
30+
certResolver = "le"
31+
[[entryPoints.https.http.tls.domains]]
32+
main = "*.example.com"
33+
sans = ["*.example.com", "example.com"]
34+
35+
[providers]
36+
[providers.docker]
37+
watch = true
38+
exposedByDefault = false
39+
endpoint = "unix:///var/run/docker.sock"
40+
useBindPortIP = false
41+
network = "traefik"
42+
swarmMode = false
43+
[providers.file]
44+
watch = true
45+
directory = "/etc/traefik/conf"
46+
# debugLogGeneratedTemplate = true
47+
48+
[certificatesResolvers.le.acme]
49+
50+
storage = "/data/ssl/acme.json"
51+
keyType = "EC256"
52+
[certificatesResolvers.le.acme.dnsChallenge]
53+
provider = "cloudflare"
54+
delayBeforeCheck = 15
55+
resolvers = ["1.1.1.1:53", "8.8.8.8:53"]

0 commit comments

Comments
 (0)