【问题标题】:Traefik is not creating certs for subdomains using the docker backendTraefik 没有使用 docker 后端为子域创建证书
【发布时间】:2018-03-24 18:27:11
【问题描述】:

当为 traefik 使用 docker 后端时,我们只为主域生成加密证书,而不为任何子域生成。我已遵循本指南:Docker and Lets Encrypt。主域具有来自 Let encrypt 的证书。运行带有标签的 docker 容器时,不会生成证书。

Docker 版本 = 17.10,Traefik 版本 = traefik:1.5

这是我的 traefik.toml 配置:

 defaultEntryPoints = ["http", "https"]

[web]
address = ":8080"

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

[acme]
email = "email@example.com"
storage = "acme.json"
entryPoint = "https"
  [acme.httpChallenge]
  entryPoint = "http"
OnHostRule = true

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

这是我正在使用的标签:

  "traefik.backend": "test",
  "traefik.docker.network": "proxy",
  "traefik.enable": "true",
  "traefik.frontend.rule": "Host:test.example.com",
  "traefik.port": "8000"

example.com 上的证书是:

Issued to: example.com
Issued by: Lets Encrypt Authority X3

test.example.com 上的证书是:

Issued to: TRAEFIK DEFAULT CERT
Issued by: TRAEFIK DEFAULT CERT

有谁知道我做错了什么?

【问题讨论】:

  • Lets-encrypt 仅发给:example.com。 traefik 是否运行 cert-bot 来生成证书?

标签: docker ssl lets-encrypt traefik


【解决方案1】:

这是我让它工作的唯一方法:通过像这样指定 acme.domains

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

[entrypoints.traefik]
  address=":8080"

[api]
  dashboard = true
  entryPoint = "traefik"

defaultEntryPoints = ["http", "https"]
[entryPoints]
  [entryPoints.http]
  address = ":80"
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]

[acme]
email = "email@example.com"
storage = "acme.json"
entryPoint = "https"
acmeLogging = true
  [acme.httpChallenge]
  entryPoint = "http"

  [[acme.domains]]
    main = "domain1.com"
    sans = ["www.domain1.com","other.domain1.com"]
  [[acme.domains]]
    main = "domain2.com"
    sans = ["www.domain2.com","other.domain2.com"]

【讨论】:

  • 有没有办法在事先不知道子域的情况下做到这一点?
  • 现在让我们加密支持wildcards cert,以及traefik config here
猜你喜欢
  • 1970-01-01
  • 2020-01-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-06-01
  • 1970-01-01
相关资源
最近更新 更多