mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-21 18:56:50 +00:00
Repeating auth_basic entries for *.php and *.js, otherwise admin/index.http page loads without 401, and instead pops 401 on each resource it requests, resulting in "js is disabled" message.
parent
32f4b394f6
commit
a1eb9f8f1c
1 changed files with 5 additions and 1 deletions
|
@ -26,10 +26,14 @@ server {
|
|||
location ~ \.php$ {
|
||||
include snippets/fastcgi-php.conf;
|
||||
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
|
||||
auth_basic "Restricted"; #For Basic Auth
|
||||
auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth
|
||||
}
|
||||
|
||||
location /*.js {
|
||||
index pihole/index.js;
|
||||
auth_basic "Restricted"; #For Basic Auth
|
||||
auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth
|
||||
}
|
||||
|
||||
location /admin {
|
||||
|
@ -51,7 +55,7 @@ server {
|
|||
. `service php7.0-fpm start` #start php7.0-fpm daemon
|
||||
. `service nginx start` #start nginx webserver
|
||||
. If you want to use your custom domain to access admin page (e.g.: `http://mydomain.internal/admin/settings.php` instead of `http://pi.hole/admin/settings.php`), make sure `mydomain.internal` is assigned to `server_name` in `/etc/nginx/sites-available/default`. E.g.: `server_name mydomain.internal;`
|
||||
. To retain the functionality of the block page when directly accessing blacklisted domains, `$serverName = escapeshellcmd($_SERVER['SERVER_NAME']);` should be replaced with `$serverName = escapeshellcmd($_SERVER['HTTP_HOST']);` in `pihole/index.php`. With Nginx, if `server_name` is not defined in the server config it defaults to `""`, whereas in Lighttpd it defaults to `hostname`.
|
||||
. To retain the functionality of the block page when directly accessing blacklisted domains, `$serverName = escapeshellcmd($_SERVER['SERVER_NAME']);` should be replaced with `$serverName = escapeshellcmd($_SERVER['HTTP_HOST']);` in `pihole/index.php`. With Nginx, if `server_name` is not defined in the server config it defaults to `""`, whereas in Lighttpd it defaults to `hostname`. (HTTP_HOST is already used in current version of pi-hole)
|
||||
. If you want to use block page for any blocked domain subpage (aka Nginx 404), add this to Pihole server block in your Nginx configuration file:
|
||||
```
|
||||
error_page 404 /pihole/index.php
|
||||
|
|
Loading…
Add table
Reference in a new issue