Pi-Hole Redirect Set Up? #45

Closed
opened 2025-12-29 14:23:09 +01:00 by adam · 2 comments
Owner

Originally created by @tatnism on GitHub (Mar 5, 2025).

I have godoxy setup and running, other Docker works great. But for the life of me can't get Pi-Hole to rewrite or redirect to the /admin page. I could set it up to navigate to https://pihole.domain.com, Pi-Hole needs to navigate to https://pihole.domain.com/admin, when I do the rewrite, it would not resolve due to too many redirects. I have my Docker Compose for Pi-Hole here, any pointer would be greatly appreciated.
I can do it with Nginx Proxy Manager with "rewrite ^/$ /admin permanent;".

services:
  pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
"53:53/tcp"
"53:53/udp"
"8280:80/tcp"
"8443:443/tcp"
labels:
  proxy.pihole.port: 8280
  proxy.pihole.homepage: |
  name: Pi-Hole
  icon: "@selfhst/pi-hole.svg"
proxy.pihole.rules: |
  do: rewrite / /admin
environment:
  TZ: 'America/Los_Angeles'
  FTLCONF_dns_listeningMode: 'all'
  FTLCONF_dns_upstreams: '10.0.0.1'
volumes:
'./etc-pihole:/etc/pihole'
restart: unless-stopped
Originally created by @tatnism on GitHub (Mar 5, 2025). I have godoxy setup and running, other Docker works great. But for the life of me can't get Pi-Hole to rewrite or redirect to the /admin page. I could set it up to navigate to https://pihole.domain.com, Pi-Hole needs to navigate to https://pihole.domain.com/admin, when I do the rewrite, it would not resolve due to too many redirects. I have my Docker Compose for Pi-Hole here, any pointer would be greatly appreciated. I can do it with Nginx Proxy Manager with "rewrite ^/$ /admin permanent;". ``` services: pihole: container_name: pihole image: pihole/pihole:latest ports: "53:53/tcp" "53:53/udp" "8280:80/tcp" "8443:443/tcp" labels: proxy.pihole.port: 8280 proxy.pihole.homepage: | name: Pi-Hole icon: "@selfhst/pi-hole.svg" proxy.pihole.rules: | do: rewrite / /admin environment: TZ: 'America/Los_Angeles' FTLCONF_dns_listeningMode: 'all' FTLCONF_dns_upstreams: '10.0.0.1' volumes: './etc-pihole:/etc/pihole' restart: unless-stopped ```
adam closed this issue 2025-12-29 14:23:09 +01:00
Author
Owner

@yusing commented on GitHub (Mar 5, 2025):

I know the current rules syntax is not ideal and confusing, example below anyways:

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "8280:80/tcp"
      - "8443:443/tcp"
    labels:
      proxy.pihole.port: 8280
      proxy.pihole.homepage: |
        name: Pi-Hole
        icon: "@selfhst/pi-hole.svg"
      proxy.pihole.rules: |
        - on: path /
          do: rewrite / /admin
        - name: default
          do: pass
    environment:
      TZ: 'America/Los_Angeles'
      FTLCONF_dns_listeningMode: 'all'
      FTLCONF_dns_upstreams: '10.0.0.1'
      FTLCONF_webserver_api_password: 'test'
    volumes:
      - './etc-pihole:/etc/pihole'
    restart: unless-stopped
@yusing commented on GitHub (Mar 5, 2025): I know the current rules syntax is not ideal and confusing, example below anyways: ```yaml services: pihole: container_name: pihole image: pihole/pihole:latest ports: - "53:53/tcp" - "53:53/udp" - "8280:80/tcp" - "8443:443/tcp" labels: proxy.pihole.port: 8280 proxy.pihole.homepage: | name: Pi-Hole icon: "@selfhst/pi-hole.svg" proxy.pihole.rules: | - on: path / do: rewrite / /admin - name: default do: pass environment: TZ: 'America/Los_Angeles' FTLCONF_dns_listeningMode: 'all' FTLCONF_dns_upstreams: '10.0.0.1' FTLCONF_webserver_api_password: 'test' volumes: - './etc-pihole:/etc/pihole' restart: unless-stopped ```
Author
Owner

@tatnism commented on GitHub (Mar 5, 2025):

Amazing, it is working. Thank you very much!

@tatnism commented on GitHub (Mar 5, 2025): Amazing, it is working. Thank you very much!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/godoxy-yusing#45