gpt4 book ai didi

Docker Traefik 和 Letsencrypt 通配符

转载 作者:IT老高 更新时间:2023-10-28 21:25:38 66 4
gpt4 key购买 nike

我一直在尝试让 traefik 在我的域上安装通配符证书,这需要 dns 挑战从阅读日志来看,它似乎能够实际颁发证书但没有正确安装它们

time="2018-04-07T19:10:35Z" level=debug msg="Unable to marshal provider conf *acme.Provider with error: json: unsupported type: chan *acme.StoredData"
legolog: 2018/04/07 19:10:57 [INFO][example.tld] The server validated our request
legolog: 2018/04/07 19:10:58 [INFO][*.example.tld] acme: Validations succeeded; requesting certificates
legolog: 2018/04/07 19:11:01 [INFO][*.example.tld] Server responded with a certificate.
time="2018-04-07T19:11:01Z" level=error msg="Error loading new configuration, aborted unable to generate TLS certificate : tls: failed to find any PEM data in certificate input"
time="2018-04-07T19:12:33Z" level=debug msg="http2: server: error reading preface from client ******omitted***: remote error: tls: unknown certificate authority"

我的域名 DNS 提供商是 cloudflare

这是我的 docker docker-compose.yml

version: '2'

services:
traefik:
image: traefik:1.6.0-rc4
command: --api --docker
restart: always
ports:
- 80:80
- 443:443
- 8080:8080
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/traefik/traefik.toml:/traefik.toml
- /opt/traefik/acme.json:/acme.json
environment:
- CLOUDFLARE_EMAIL=admin@example.tld
- CLOUDFLARE_API_KEY=
container_name: traefik

networks:
web:
external: true

还有我的 traefik.toml

debug = true

logLevel = "DEBUG"
defaultEntryPoints = ["https","http"]

[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]

[retry]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "example.tld"
watch = true
exposedbydefault = false

[acme]
email = "admin@example.tld"
storage = "acme.json"
entryPoint = "https"
OnHostRule = true
acmeLogging = true
[acme.dnsChallenge]
provider = "cloudflare"
delayBeforeCheck = 0

[[acme.domains]]
main = "example.tld"
[[acme.domains]]
main = "*.example.tld"

最佳答案

我能够解决问题,这是我的错误。

在 traefik.toml您不能将 OnHostRule = true 用于通配符证书

阅读更多:docs.traefik.io/v1.7/configuration/acme/#onhostrule

关于Docker Traefik 和 Letsencrypt 通配符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49711605/

66 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com