Enhance Pi-hole configuration with additional proxy headers and settings for improved request handling

This commit is contained in:
Nik Afiq 2026-01-24 21:01:49 +09:00
parent d3ea74d718
commit c7095bf359

View File

@ -73,16 +73,32 @@ server {
# ---- Pi-hole admin at /admin/ ----
# Pi-holes 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/