I am using Traefik 2.8.3 in docker:
And this is my docker-compose.yaml file:
version: '3'
services:
reverse-proxy:
image: traefik:latest
hostname: "traefik"
container_name: traefik
restart: unless-stopped
environment:
- LINODE_TOKEN=SECRET_TOKEN_REMOVED
labels:
- "diun.enable: true"
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.home.local`)"
- "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.tls=true"
- "traefik.http.middlewares.testHeader.headers.framedeny=true"
- "traefik.http.middlewares.testHeader.headers.browserxssfilter=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=linodev4"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=my.website.com"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.my.website.com"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.services.dummy-svc.loadbalancer.server.port=9999"
command:
- "--api.dashboard=true"
- "--providers.docker"
- "--providers.docker.swarmMode=false"
- "--entrypoints.web.address=:80"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.network=web"
- "--certificatesresolvers.mydnschallenge.acme.dnschallenge=true"
- "--certificatesresolvers.mydnschallenge.acme.dnschallenge.provider=linodev4"
- "--certificatesresolvers.mydnschallenge.acme.email=myemail@gmail.com"
- "--certificatesresolvers.mydnschallenge.acme.storage=/letsencrypt/acme.json"
- "--certifiCatesresolvers.mydnschallenge.acme.httpchallenge.entrypoint=http"
- "--log.level=DEBUG"
- "--log.filePath=/var/log/traefik.log"
- "--accessLog.filePath=/var/log/access.log"
ports:
- target: 443
published: 443
mode: host
- target: 80
published: 80
mode: host
- target: 8080
published: 8080
mode: host
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/ansible/stacks/traefik/:/letsencrypt
- /var/log/traefik.log:/var/log/traefik.log
- /var/log/access.log:/var/log/access.log
- /home/ansible/stacks/traefik/static/traefik.yml:/traefik.yml
- /home/ansible/stacks/traefik/config:/config/
networks:
- web
networks:
web:
external: true
and this is my pihole config file
# As YAML Configuration File
http:
routers:
router-pihole:
entrypoints:
- "https"
service: pihole-service
rule: "Host(`pihole.my.website.com`)"
middlewares:
- testHeader@docker
- default-headers
- https-redirectscheme
tls:
certResolver: "linodev4"
domains:
- main: "my.website.com"
sans:
- "*.my.website.com"
services:
pihole-service:
loadBalancer:
servers:
- url: "http://192.168.1.66:80"
middlewares:
https-redirectscheme:
redirectScheme:
scheme: https
permanent: true
default-headers:
headers:
frameDeny: true
sslredirect: true
browserXssFilter: true
contentTypeNosniff: true
forceSTSHeader: true
stsIncludeSubdomains: true
stsPreload: true
stsSeconds: 15552000
customFrameOptionsValue: SAMEORIGIN
customRequestHeaders:
X-Forwarded-Proto: https
but when I try to open pihole.my.website.com
I get this error: