【发布时间】:2020-04-16 22:11:43
【问题描述】:
我是使用 Traefik 的 SSL 证书的新手,并且在成功部署时遇到了真正的麻烦。
我有一个服务器和域,我已经部署了我的应用程序,使用 Traefik 和 Http 没有问题。我现在想部署相同的应用程序,在端口 9000 上运行,在 Traefik docs 之后使用 LetsEncrypt 部署在 Https 中。我可以使用 SSL 检查器验证证书是否已正确创建,但是,当我尝试访问该站点时,我得到了Internal Server Error。两个 docker 日志中都没有报告错误,我不知道接下来要尝试什么。
docker-compose.yml
version: '2'
services:
traefik:
image: traefik:v1.7
restart: always
ports:
- 80:80
- 443:443
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/traefik/traefik.toml:/traefik.toml
- /opt/traefik/acme.json:/acme.json
container_name: traefik
app:
image: myapp_image
container_name: app
restart: always
networks:
- web
ports:
- "9000:9000"
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.basic.frontend.rule=Host:myapp.com"
- "traefik.basic.port=9000"
- "traefik.basic.protocol=http"
- "traefik.admin.frontend.rule=Host:myapp.com"
- "traefik.admin.protocol=https"
- "traefik.admin.port=9000"
networks:
web:
external: true
traefik.toml
debug = false
logLevel = "ERROR"
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 = "myapp.com"
watch = true
exposedByDefault = false
[acme]
email = "myemail@email.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"
【问题讨论】:
标签: docker ssl https lets-encrypt traefik