Hello everybody,
Currently I am trying to make Pi-hole avaible with the Traefik-v2-Proxy on my network. I looked at some toutorials on the internet and also experimented myself. But unfornunately it does not work.
My docker-compose.yaml for Traefik
version: "3.4"
networks:
bridge_proxy:
external: true
services:
traefik:
tty: false
image: traefik:latest
restart: unless-stopped
hostname: traefik.nonprod.fritz.box
container_name: traefik
dns: 172.31.200.2
dns_search: nonprod.fritz.box
extra_hosts:
- "dev-srv:192.168.0.40"
ports:
- "80:80/tcp"
- "443:443/tcp"
- "8080:8080/tcp"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
bridge_proxy:
ipv4_address: 172.31.201.1
command:
- "--log.level=DEBUG"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.network=bridge_proxy"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--global.checknewversion=false"
- "--global.sendanonymoususage=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.traefik.address=:8080"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--api.insecure=true"
- "--api.dashboard=true"
- "--api.debug=true"
My docker-compose.yaml for Pi-hole:
version: "3.4"
networks:
bridge_proxy:
external: true
services:
pihole:
image: pihole/pihole:latest
restart: unless-stopped
hostname: pihole.nonprod.fritz.box
container_name: pihole
cap_add:
- NET_ADMIN
extra_hosts:
- "dev-srv:192.168.0.40"
ports:
- "53:53/udp"
- "53:53/tcp"
volumes:
- './etc_pihole/:/etc/pihole'
- './etc_dnsmasq.d/:/etc/dnsmasq.d'
environment:
TZ: 'Europe/Berlin'
WEBPASSWORD: 'foobar'
DNS1: '192.168.0.1'
DNS2: '8.8.4.4'
networks:
bridge_proxy:
ipv4_address: 172.31.200.3
labels:
- "traefik.enable=true"
- "traefik.docker.network=bridge_proxy"
# routers configuration
- "traefik.http.routers.pihole.entrypoints=websecure"
- "traefik.http.routers.pihole.rule=Host(`dev-srv.fritz.box`)&&Path(`/pihole`)"
- "traefik.http.routers.pihole.middlewares=addprefix-pihole"
- "traefik.http.routers.pihole.service=pihole"
# middlewares configuration
- "traefik.http.middlewares.addprefix-pihole.addprefix.prefix=/admin"
# services configuration
- "traefik.http.services.pihole.loadbalancer.server.port=80"
- "traefik.http.services.pihole.loadbalancer.passhostheader=true"
I can access Pi-Hole by ip address (172.31.200.3). There I can log in and the website is displayed to me completely. If I open Pi-hole with the Traefik-URL (https://dev-srv.fritz.box/pihole) then I have the error message 404.
Can you help me please? Thanks in advance.
Greetings Erik