【问题标题】:Using Traefik with TLS (acme plugin) on non HTTP port for HTTP traffic在非 HTTP 端口上使用 Traefik 和 TLS(acme 插件)进行 HTTP 流量
【发布时间】:2019-08-13 07:44:51
【问题描述】:

与问题“Traefik and Let's Encrypt on non default http port 80?”不同,我在默认 http 端口上运行 Traefik (> 1.7)。

我想为8448 上的一项服务的 HTTP 流量配置一个额外的入口点。所以我已将此入口点添加到我的traefik.toml

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

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

[api]

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

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

我的 docker 服务通过以下标签使用此端口:

labels:
  - traefik.enable=true
  - traefik.clients.frontend.rule=Host:matrix.example.com
  - traefik.clients.port=8008
  - traefik.clients.docker.network=proxy
  - traefik.federation.frontend.rule=Host:matrix.example.com
  - traefik.federation.port=8448
  - traefik.federation.docker.network=proxy
  - traefik.federation.frontend.entryPoints=synapse

不幸的是,Traefik 根本没有公开这个端口,尽管我的 docker 容器确实这样做了。日志没有显示任何错误,但显示入口点是由 Traefik 设置的。

有人知道我做错了什么吗?

该设置按预期适用于其他入口点。

【问题讨论】:

    标签: docker traefik


    【解决方案1】:

    Let's Encrypt 要求 TLS challenge 使用端口 443,这是 Let's Encrypt 约束(或 HTTP challenge 使用端口 80)。

    https://community.letsencrypt.org/t/support-for-ports-other-than-80-and-443/3419/72

    您也可以使用DNS Challenge

    【讨论】:

    • 端口 80 和 443 都可以使用。 Traefik 已经获得了clients 段的证书,该证书可以用于联合段。如何配置 Traefik 使用现有证书?
    • 如果我配置 DNS 质询,它会像问题帖子中所示那样工作吗?
    • 我认为你可以通过使用domains来实现你想要的
    • 你能告诉我你到底是什么意思吗?
    猜你喜欢
    • 2023-01-04
    • 1970-01-01
    • 1970-01-01
    • 2019-07-04
    • 1970-01-01
    • 1970-01-01
    • 2019-06-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多