docker-pi-hole icon indicating copy to clipboard operation
docker-pi-hole copied to clipboard

Webserver RootPATH

Open GitHubSwimmer opened this issue 8 months ago • 10 comments

After updating pihole, I was sad to discover that pihole is now running amok with its paths.

In addition to the /admin/ path, it now uses countless order paths under /api/, which is quite inconvenient if other applications are running on the web server in the /api path.

Please create an adjustable path pointer.

A subdomain for pihole as an alternative would be pointless.

GitHubSwimmer avatar Mar 10 '25 11:03 GitHubSwimmer

Pi-hole's webserver is embedded (per https://pi-hole.net/blog/2025/02/18/introducing-pi-hole-v6/) If paths are conflicting, perhaps run it on a different port.

(see /etc/pihole/pihole.toml -> webserver.ports)

However, as you've posted this in the docker repo - I'm even more confused. What does your setup look like? (We have a template for issues for a very good reason, you know 😉 )

PromoFaux avatar Mar 10 '25 12:03 PromoFaux

Changing the web server ports also makes no sense, since pihole runs behind an extensively configured reverse proxy and no other port may be opened to the outside

GitHubSwimmer avatar Mar 10 '25 13:03 GitHubSwimmer

What does your docker compose look like?

PromoFaux avatar Mar 10 '25 13:03 PromoFaux

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      #- "53:53/tcp"
      - "10.0.13.4:1453:53/udp"
      - "10.0.13.4:8090:80/tcp"
    environment:
      TZ: 'Europe/Amsterdam'
      FTLCONF_webserver_api_password: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
      FTLCONF_dns_listeningMode: 'all'
    volumes:
      - './etc-pihole:/etc/pihole'
    cap_add:
      - SYS_NICE
    restart: unless-stopped

GitHubSwimmer avatar Mar 10 '25 13:03 GitHubSwimmer

  • "10.0.13.4:8090:80/tcp"

Right, OK - so presumably host networking here and you're mapping 8090 outside the container to 80 inside it.

Can you try setting the web interface port to listen on port 8090 inside the container with env var:

FTLCONF_webserver_ports: '8090'

And then changing your ports section to suit.

PromoFaux avatar Mar 10 '25 13:03 PromoFaux

Note that there is a PR currently under review allowing prefacing. Would that work for your setup? You could then host Pi-hole under, e.g., www.example.com/pihole and both /api and /admin will be inside this prefix.

Have a look over at https://github.com/pi-hole/FTL/pull/2319, the referenced issue https://github.com/pi-hole/FTL/issues/2298 has an exemplary docker-compose.yml showing how it could be used with traefik as reverse proxy.

DL6ER avatar Mar 10 '25 18:03 DL6ER

I have exactly the same issue in a K3s cluster with my pihole deployment's.

In the prev release i could manage the web root via env var

'VIRTUAL_HOST: <your.url.&.domain>/subpath'

Something like that var would be great in v6

the-daame avatar Mar 16 '25 13:03 the-daame

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

github-actions[bot] avatar Apr 16 '25 08:04 github-actions[bot]

Hey together,

i checked the issues https://github.com/pi-hole/FTL/pull/2319 & https://github.com/pi-hole/FTL/issues/2298 regarding the Webroot behind a reverse proxy.

But i don't get it running in my k3s cluster with a nginx ingress controller in front of it.

Is there maybee someone who could explain, how this option should be used?

webserver.paths.prefix

from https://github.com/pi-hole/FTL/pull/2319

In my current deployment i still use release pihole/pihole:2024.07.0.

dpl-pihole.yaml

[...]
      containers:
      - name: pihole
        image: pihole/pihole:2024.07.0
        imagePullPolicy: IfNotPresent
        env:
        - name: TZ
          valueFrom:
            configMapKeyRef:
              name: pihole-1-env
              key: TZ
        - name: PIHOLE_DNS_
          valueFrom:
            configMapKeyRef:
              name: pihole-1-env
              key: PIHOLE_DNS_
        - name: VIRTUAL_HOST
          valueFrom:
            configMapKeyRef:
              name: pihole-1-env
              key: VIRTUAL_HOST
[...]

config-pihole.yaml

[...]
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: pihole-1env
  namespace: homelab
data:
  TZ: Germany/Berlin
  PIHOLE_DNS_: <upstream.dns.1>;<upstream.dns.2>
  VIRTUAL_HOST: <your.domain.anything>/pihole
[...]

Thanks in advance

the-daame avatar Apr 17 '25 14:04 the-daame

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

github-actions[bot] avatar May 18 '25 08:05 github-actions[bot]

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

github-actions[bot] avatar Jun 18 '25 08:06 github-actions[bot]

updated to v6 and wondering that i can no longer define an absolute uri for pihole. im running it on my local network in a subdir - serving all docker containers via dashboard. so domain.com/folderA/pihole and this seems no longer working :/

bitdruid avatar Jun 26 '25 21:06 bitdruid

No one with a solution here?

the-daame avatar Sep 29 '25 22:09 the-daame