Add Pi-hole v6 fix for /admin/api redirection and proxy handling

This commit is contained in:
Nik Afiq 2026-01-24 21:12:30 +09:00
parent b6a4c475fb
commit bf61829ba6

View File

@ -70,6 +70,24 @@ server {
proxy_set_header X-Forwarded-Prefix /anime;
}
# ---- Pi-hole v6 fix: map /admin/api/* -> /api/* ----
location = /admin/api {
return 301 /api/;
}
location ^~ /admin/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_redirect off;
}
# ---- Pi-hole admin at /admin/ ----
# Pi-holes UI lives under /admin/, so keep the trailing slash in proxy_pass.
location /admin/ {