在我移动 docker-compose.yml 文件的位置之前,下面的配置运行良好。现在我在浏览器中收到无效的证书消息“此 CA 根证书不受信任,因为它不在受信任的根证书颁发机构存储中。” 对于自签名证书。不确定是什么导致了问题。
services:
traefik:
image: "traefik:v2.0.2"
container_name: "traefik"
command:
- "--entrypoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--api"
- "--providers.docker"
- "--certificatesResolvers.le-resolver.acme.email=test@nodomain.com"
- "--certificatesResolvers.le-resolver.acme.storage=acme.json"
- "--certificatesResolvers.le-resolver.acme.httpChallenge.entryPoint=web"
labels:
# global redirect to https
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
# middleware redirect
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./data/acme.json:/acme.json"