From c7095bf359f0d335014a770fed994b52b1814e4d Mon Sep 17 00:00:00 2001 From: Nik Afiq Date: Sat, 24 Jan 2026 21:01:49 +0900 Subject: [PATCH] Enhance Pi-hole configuration with additional proxy headers and settings for improved request handling --- nik4nao.home.arpa.conf | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nik4nao.home.arpa.conf b/nik4nao.home.arpa.conf index 7f3c63b..c3858e6 100644 --- a/nik4nao.home.arpa.conf +++ b/nik4nao.home.arpa.conf @@ -73,16 +73,32 @@ server { # ---- Pi-hole admin at /admin/ ---- # Pi-hole’s UI lives under /admin/, so keep the trailing slash in proxy_pass. location /admin/ { - proxy_pass http://pihole_upstream/admin/; + proxy_pass http://pihole_upstream/admin/;Ï include snippets/proxy-common.conf; + + proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_http_version 1.1; + proxy_redirect off; } # Pi-hole API (some UI calls hit /api/) location /api/ { proxy_pass http://pihole_upstream/api/; include snippets/proxy-common.conf; + + proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_http_version 1.1; + proxy_redirect off; } # redirect /watch-party -> /watch-party/