Timeouts when trying to reach Pihole Admin via Traefik

Please follow the below template, it will help us to help you!

Expected Behaviour:

I'm expecting to be able to access the web admin via my custom domain via traefik. (https://pihole.[server-name].lan) does not work, but 192.168.x.x:8053 (the port I have exposed in docker) does work. This is running as a docker-compose service, on Ubuntu 21.04. (Semi-related, the TEMPERATUREUNIT variable doesn't appear to change the actual temperature unit in the web ui, so maybe my environment variables aren't working properly?)

Actual Behaviour:

When trying to curl or reach my server in browser using my custom domain, I'm unable to reach the admin panel. I keep getting ERR_CONNECTION_TIMED_OUT.
I am able to reach other subdomains, so I know traefik is working.
My guess is I have to configure something differently with Traefik or the admin panel's nginx server is somehow not allowing me to access my website.
Here is what I have configured in my docker-compose file.

pihole:
    depends_on: [unbound]
    container_name: pihole
    image: pihole/pihole:master-amd64-buster
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "8053:80/tcp"
    hostname: pihole
    domainname: $SERVER_DOMAIN
    dns:
      - 127.0.0.1
      - $UNBOUND_IP_ADDRESS
    environment:
      TZ: $TZ
      PIHOLE_DNS_: $UNBOUND_IP_ADDRESS
      ServerIP: $SERVER_IP_ADDRESS
      PROXY_LOCATION: pihole
      VIRTUAL_HOST: pihole.$SERVER_DOMAIN
      WEBPASSWORD: "password"
      PIHOLE_DOMAIN: $SERVER_DOMAIN
      TEMPERATUREUNIT: "f"
    volumes:
      - "./services/pihole/:/etc/pihole/"
      - "./config/dnsmasq/:/etc/dnsmasq.d/"
    cap_add:
      - NET_ADMIN
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
    networks:
      traefik:
      vpn:
        ipv4_address: $PIHOLE_IP_ADDRESS

Here is my Traefik config:

http:
  routers:
    pihole:
      entryPoints:
        - https
      rule: Host(`pihole.{{env "SERVER_DOMAIN"}}`)
      service: pihole-svc
      middlewares: admin-prefix
      tls: {}

  services:
    pihole-svc:
      loadBalancer:
        servers:
          - url: "http://{{env `SERVER_IP_ADDRESS`}}:8053/"

  middlewares:
    admin-prefix:
      addPrefix:
        prefix: "/admin/"

I also "whitelisted" the SERVER_DOMAIN value, and it still just loads forever.

Debug Token:

https://tricorder.pi-hole.net/ITsA21mX/

Have you tried https://pihole.[server-name].lan/admin

with a trailing admin.

1 Like

Wow, @jfb, thanks for the speedy reply! I tried that and it didn't work.
However, I actually just figured it out. Based on Pihole resolving its ip as internal IP - #2 by Bucking_Horn - the issue I was having was defining domainname and hostname in my docker-compose file. When I removed those, I was able to reach the admin panel via https://pihole.[server-name].lan

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.