Hello, everyone,
I'm having some trouble obtaining my cert. My domain was registered through google, but I changed my nameservers to CloudFlare. My slightly edited for security configs are:
traefik.yml
api:
dashboard: true
debug: true
entryPoints:
http:
address: ":80"
https:
address: ":443"
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
file:
filename: /config.yml
certificatesResolvers:
cloudflare:
acme:
email: email_from_google@email.com
storage: /acme.json
dnsChallenge:
provider: cloudflare
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"
docker-compose.yml
version: '3'
services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
environment:
- CF_API_EMAIL= cloud_flare_account_email@email.com
- CF_API_KEY= cloud_flare_global_api
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /root/traefik/data/traefik.yml:/traefik.yml:ro
- /root/traefik/data/acme.json:/acme.json
- /root/traefik/data/config.yml:/config.yml:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`traefik.mydomain.network`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=user:hashed_password"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`traefik.mydomain.network`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=mydomain.network"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.mydomain.network"
- "traefik.http.routers.traefik-secure.service=api@internal"
networks:
proxy:
external: true
After running, my acme.json reads:
{
"cloudflare": {
"Account": {
"Email": "cloud_flare_account_email@email.com",
"Registration": {
"body": {
"status": "valid",
"contact": [
"mailto:cloud_flare_account_email@email.com"
]
},
"uri": "https://acme-v02.api.letsencrypt.org/acme/acct/123193476"
},
"PrivateKey": "private_key"
"KeyType": "4096"
},
"Certificates": null
}
}
Any help is greatly appreciated!