Pihole Admin Panel 404

So i'm pretty new to traeffic and in the last fiew days i spend hours playing around with it on my raspberry pi on docker and reading different guides & documentation.

Now i finally got traefik to work (dashboard reachable on lan) and started working on connecting my first container to it. I decided to use pi hole for this because i kinda need a dns server for my planned (future) setup to work and i really like the idea of having a network wide ad-blocker.

I set everything up, started the new container and tryed reaching pi hole admin panel.
Sadly now i simply get a "404 page not found" from traefik. I tinkered around on my compose files of both containers for the last two days but i can't seem to get it to work.

I'm currently trying to get this to work without a dedicated sub domain but i'm simply unable to reach the admin page of pi hole via host-ip:80 or host-ip:80/admin

I would be really glad if somebody could take a look at my configuration and point me at the right direction because i'm pretty much lost at this point.

Traefik compose.yml

`##############################

Traefik compose file

##############################

version: "3.8"

services:

Reverse proxy

traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
- dns
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/pi/docker/config/traefik:/etc/traefik
- /home/pi/docker/logs/traefik/:/logs

networks:
proxy:
external: true
dns:
external: true`

Pi hole compose.yml

`##############################

Pihole compose file

##############################

version: "3.8"

services:

DNS & network filter

pihole:
image: pihole/pihole:latest
container_name: pihole
restart: unless-stopped
environment:
TZ: 'Europe/Berlin'
WEBPASSWORD: 'test'
security_opt:
- no-new-privileges:true
networks:
- dns
- proxy
volumes:
- /etc/localtime:/etc/localtime:ro
- /home/pi/docker/config/pihole/:/etc/pihole/
- /home/pi/docker/config/pihole/dnsmasq.d/:/etc/dnsmasq.d/
- /home/pi/docker/logs/pihole/pihole.log:/var/log/pihole.log
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"

  # HTTP
  - "traefik.http.routers.pihole.entrypoints=web"
  - "traefik.http.routers.pihole.service=pihole"
  - "traefik.http.services.pihole.loadbalancer.server.port=80"

  # TCP
  - "traefik.tcp.routers.pihole.entrypoints=dns_tcp"
  - "traefik.tcp.routers.pihole.rule=HostSNI(`*`)"
  - "traefik.tcp.routers.pihole.service=dns_tcp"
  - "traefik.tcp.services.dns_tcp.loadbalancer.server.port=53"

  # UDP
  - "traefik.udp.routers.pihole.entrypoints=dns_udp"
  - "traefik.udp.routers.pihole.service=dns_udp"
  - "traefik.udp.services.dns_udp.loadbalancer.server.port=53"

networks:
dns:
external: true
proxy:
external: true`

Traefik config.yml

`entryPoints:
dns_tcp:
address: ":53/tcp"

dns_udp:
address: ":53/udp"

web:
address: ":80"

web-secure:
address: ":443"

providers:
docker:
endpoint: unix:///var/run/docker.sock
watch: true
exposedByDefault: false

api:
dashboard: true
insecure: true`

Hello RedPanda,

I recommend you use a domain in order to create the appropriate routing to your apps. You can try that service https://www.noip.com/. It should be great for playing with Traefik in a local environment.

Please also have a look at the documentation who the example service is exposed via Traefik
https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/

Keep your configuration simple and start with only one router at the same time, e.g.http. Once you configure it correctly try to add another that you have in your configuration file.

Thank you,

Actually, I wanted to suggest using nip.io instead of noip.com - it was a typo :slight_smile:

Here is the working configuration from your example:

version: "3.3"

services:
  traefik:
    image: "traefik:v2.4"
    container_name: "traefik_test"
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "8080:80"
      - "8081:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
  whoami:
    image: "traefik/whoami"
    container_name: "test-service"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.rule=Host(`127.0.0.1.nip.io`)"
      - "traefik.http.routers.whoami.entrypoints=web"

Hope that helps!