我的域名 jstock.co
DNS 和 SSL 证书由 Cloudflare 处理。
我有以下traefik.toml
defaultEntryPoints = ["http", "https"]
[web]
address = ":8080"
[web.auth.basic]
users = ["admin:xxx"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
CertFile = "/app/cert.pem"
KeyFile = "/app/key.pem"
通过上述设置,traefik 能够将以下流量重新路由到正确的 docker 容器
https://notification.jstock.co/info/
https://iex.jstock.co/info/
https://intrinio.jstock.co/info/
- ...
现在,我们购买了另一个域名wenote.me
。其 DNS 和 SSL 证书也由 Cloudflare 处理。
我想知道是否可以重用现有的 Traefik 来处理来自 wenote.me
的流量?如果是这样,traefik.toml
应该是什么样子?
最佳答案
这就是它的完成方式。
defaultEntryPoints = ["http", "https"]
[web]
address = ":8080"
[web.auth.basic]
users = ["admin:xxx"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
CertFile = "/app/cert.pem"
KeyFile = "/app/key.pem"
[[entryPoints.https.tls.certificates]]
CertFile = "/app/wenote.me.cert.pem"
KeyFile = "/app/wenote.me.key.pem"
关于traefik - Traefik 是否可以处理多个证书/域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56515926/