Hi there,
First time poster here so apologies if this has been resolved before, I can't seem to find the right solution!
I'm still a novice user of Docker/traefik/Lets Encrypt - really enjoying it so far.
I currently use Traefik/Let's Encrypt successfully for multiple docker containers but would also like to host a WordPress site under a different domain. I've researched and added (what I think..) are the correct labels but my WordPress site still shows up as "not secure".
Any help would be most appreciated. Traefik docker-compose below!
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= <EMAIL>
- CF_DNS_API_TOKEN= <tOKEN>
- CF_API_KEY= <KEY>
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/afmod/traefik/data/traefik.yml:/traefik.yml:ro
- /home/afmod/traefik/data/acme.json:/acme.json
- /home/afmod/traefik/data/config.yml:/config.yml:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`traefik-dashboard.domain.domain.domain`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=afmod:<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-dashboard.domain.domain.domain`)"
- "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=domain.domain.domain"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.domain.domain.domain"
- "traefik.http.routers.traefik-secure.tls.domains[1].main=domain2.domain2.domain2"
- "traefik.http.routers.traefik-secure.tls.domains[1].sans=*.domain2.domain2.domain2"
- "traefik.http.routers.traefik-secure.service=api@internal"
networks:
proxy:
external: true