[英]Traefik initialization is failed in docker container with acme.json . “Receiving Error creating TLS config: private key was nil”
I have tried to setup Traefik with acme.json but upon the container startup I am getting following errors 我试图用acme.json设置Traefik,但是在容器启动时,我得到以下错误
level=error msg="Cannot unmarshall private key []"
level=error msg="Error creating TLS config: private key was nil"
level=fatal msg="Error preparing server: private key was nil"
docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $PWD/traefik.toml:/traefik.toml \
-v $PWD/acme.json:/acme.json \
-p 80:80 \
-p 443:443 \
-l traefik.frontend.rule=Host:abc.com\
-l traefik.port=8080 \
--network proxy \
--name traefik \
traefik:1.3.6-alpine --docker
defaultEntryPoints = ["http", "https"]
[web]
address = ":8080"
[web.auth.basic]
users = ["admin:$apr1$fwifc.Nx$xfuaGzJ6Jzdf347PQzxD95"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[acme]
email = "abc@msn.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
onDemand = false
As per documentation you can also place your " tls certificates " in the global configuration file traefik.toml instead like: 根据文档,您还可以将“ tls证书 ”放置在全局配置文件traefik.toml中,而不是这样:
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
CertFile = "integration/fixtures/https/snitest.com.cert"
KeyFile = "integration/fixtures/https/snitest.com.key"
[[entryPoints.https.tls.certificates]]
CertFile = "integration/fixtures/https/snitest.org.cert"
KeyFile = "integration/fixtures/https/snitest.org.key"
You can find more information here and also in stackoverflow here . 你可以找到更多的信息, 这里的计算器,并在这里 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.