Add Pi-hole v6 fix for /admin/api redirection and proxy handling
This commit is contained in:
parent
b6a4c475fb
commit
bf61829ba6
@ -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-hole’s UI lives under /admin/, so keep the trailing slash in proxy_pass.
|
||||
location /admin/ {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user