Skip to content

[BUG] PIHOLE v6 new location /api #579

@napalmz

Description

@napalmz

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

On PIHOLE sample you need to add this new location to avoid errors 500 when browsing queries on PiHole:

location ~ ^/api/ {
    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app 10.0.1.20;
    set $upstream_port 80;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    proxy_hide_header X-Frame-Options;
}

Expected Behavior

Resolve "500" errors while browsing Queries inside PiHole.

Steps To Reproduce

  1. Login into Pihole
  2. Check any of the Queries entry
  3. Get a blocking error

Environment

- OS: Debian GNU/Linux 11 (bullseye)
- How docker service was installed: Compose

CPU architecture

arm64

Docker creation

services:
  pihole:
    container_name: pihole
    hostname: pihole
    image: pihole/pihole:latest
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    #network_mode: host
    shm_size: 2gb
    ports:
      # DNS
      - "53:53/tcp"
      - "53:53/udp"
      # DHCP
      #- "67:67/udp"
      # WEB INTERFACE
      - "80:80/tcp"
      # Default HTTPs Port. FTL will generate a self-signed certificate
      - "443:443/tcp"
    environment:
      TZ: 'Europe/Rome'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: ${WEBPASSWORD}
      # If using Docker's default `bridge` network setting the dns listening mode should be set to 'all'
      FTLCONF_dns_listeningMode: 'all'
    # Volumes store your data between container upgrades
    volumes:
      - '/home/napalmz/docker-conf/pihole/etc-pihole/:/etc/pihole/'
      - '/home/napalmz/docker-conf/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/'
      - '/var/log/pihole/:/var/log/' # per manutenzione LOG che diventano ENORMI
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      # Required if you are using Pi-hole as your DHCP server, else not needed
      - NET_ADMIN
      # Required if you are using Pi-hole as your NTP client to be able to set the host's system time
      - SYS_TIME
      # Optional, if Pi-hole should get some more processing time
      - SYS_NICE
    restart: always

Container logs

[mod-init] Running Docker Modification Logic
[mod-init] Adding linuxserver/mods:swag-maxmind to container
[mod-init] linuxserver/mods:swag-maxmind at sha256:975cff53644ab8c0c228f24b8ac713c6b3f52e5391c552fecc6e0df2156f5d9d has been previously applied skipping
[mod-init] Adding linuxserver/mods:swag-dashboard to container
[mod-init] linuxserver/mods:swag-dashboard at sha256:16d37722ab942242e62390f485e6500872d4eac524d0826ac7c96a6c4cce1516 has been previously applied skipping
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-swag-old-certbot-paths: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 4.1.1-ls397
Build-date: 2025-07-22T17:07:12+00:00
───────────────────────────────────────
    
using keys found in /config/keys
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2024-03-14 │ 2025-03-25 │ /config/nginx/authelia-location.conf                                   │
│ 2023-08-13 │ 2025-07-18 │ /config/nginx/ssl.conf                                                 │
│ 2023-04-27 │ 2025-03-25 │ /config/nginx/authentik-server.conf                                    │
│ 2023-04-13 │ 2025-05-31 │ /config/nginx/nginx.conf                                               │
│ 2024-03-16 │ 2025-03-25 │ /config/nginx/authelia-server.conf                                     │
│ 2024-03-06 │ 2025-07-18 │ /config/nginx/site-confs/default.conf                                  │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
**** The following site-confs have extensions other than .conf ****
**** This may be due to user customization. ****
**** You should review the files and rename them to use the .conf extension or remove them. ****
**** nginx.conf will only include site-confs with the .conf extension. ****
/config/nginx/site-confs/default.conf.old
Variables set:
PUID=1000
PGID=1000
TZ=Europe/Rome
URL=[redacted]
SUBDOMAINS=wildcard
EXTRA_DOMAINS=[redacted]
ONLY_SUBDOMAINS=false
VALIDATION=dns
CERTPROVIDER=zerossl
DNSPLUGIN=ovh
EMAIL=[redacted]
STAGING=false

ZeroSSL is selected as the cert provider, registering cert with [redacted]
SUBDOMAINS entered, processing
Wildcard cert for [redacted] will be requested
EXTRA_DOMAINS entered, processing
Extra domains processed are: [redacted]
E-mail address entered: [redacted]
dns validation via ovh plugin is selected
Certificate exists; parameters unchanged; starting nginx
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
**** Applying the SWAG dashboard mod... ****
libmaxminddb
**** goaccess already installed, skipping ****
**** libmaxminddb already installed, skipping ****
**** libmaxminddb already installed, skipping ****
**** Applied the SWAG dashboard mod ****
Applying the maxmind mod...
Applied the maxmind mod
[custom-init] No custom files found, skipping...
Auto-reload: Watching the following folders for changes to .conf files:
/config/nginx
[ls.io-init] done.
Server ready

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions