正确设置Traefik HTTPS

时间:2018-01-15 13:58:56

标签: traefik

所以我有几个不同的域指向我的服务器,它运行Docker和Traefik作为反向代理。

我希望Traefik将所有HTTP流量转换为HTTPS,但是对于服务器托管的每个域,是否可以拥有单独的SSL证书(由Let'加密发布)?

如果可能,我如何在traefik.toml文件中正确设置?

我明白这一点:

[entryPoints]
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]

[acme]
email = "test@traefik.io"
storage = "acme.json"
caServer = "http://172.18.0.1:4000/directory"
entryPoint = "https"

[[acme.domains]]
  main = "local1.com"
  sans = ["test1.local1.com", "test2.local1.com"]
[[acme.domains]]
  main = "local2.com"
  sans = ["test1.local2.com", "test2x.local2.com"]
[[acme.domains]]
  main = "local3.com"
[[acme.domains]]
  main = "local4.com"

但Traefik是否可以根据traefik.frontend.rule中输入的内容发送生成证书的请求?

1 个答案:

答案 0 :(得分:0)

是的,请点击此处的traefik + letsencrypt指南:https://docs.traefik.io/user-guide/docker-and-lets-encrypt/

Traefik可以连接到docker守护程序,并自动检查traefik.frontend.rule的标签,并从这些标签生成主机和SSL证书。