Merge pull request #1420 from WaLLy3K/new/https

Disable Let's Encrypt HTTPS & shift functions to block page
This commit is contained in:
WaLLy3K 2017-09-14 20:40:20 +10:00 committed by GitHub
commit c458e4a93b
2 changed files with 12 additions and 32 deletions

View file

@ -50,7 +50,8 @@ compress.filetype = ( "application/javascript", "text/css", "text/html
# default listening port for IPv6 falls back to the IPv4 port # default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl" include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl" #include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"\n' 2>/dev/null"
# If the URL starts with /admin, it is the Web interface # If the URL starts with /admin, it is the Web interface
$HTTP["url"] =~ "^/admin/" { $HTTP["url"] =~ "^/admin/" {
@ -59,21 +60,9 @@ $HTTP["url"] =~ "^/admin/" {
"X-Pi-hole" => "The Pi-hole Web interface is working!", "X-Pi-hole" => "The Pi-hole Web interface is working!",
"X-Frame-Options" => "DENY" "X-Frame-Options" => "DENY"
) )
} $HTTP["url"] =~ ".ttf$" {
# Allow Block Page access to local fonts
# Rewite js requests, must be out of $HTTP block due to bug #2526 setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
url.rewrite = ( "^(?!/admin/).*\.js$" => "pihole/index.js" )
# If the URL does not start with /admin, then it is a query for an ad domain
$HTTP["url"] =~ "^(?!/admin)/.*" {
# Create a response header for debugging using curl -I
setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." )
}
# Entering just "pi.hole" into a browser redirects to "pi.hole/admin/"
$HTTP["host"] == "pi.hole" {
$HTTP["url"] == "/" {
url.redirect = ( "" => "/admin/" )
} }
} }

View file

@ -75,22 +75,13 @@ fastcgi.server = ( ".php" =>
# If the URL starts with /admin, it is the Web interface # If the URL starts with /admin, it is the Web interface
$HTTP["url"] =~ "^/admin/" { $HTTP["url"] =~ "^/admin/" {
# Create a response header for debugging using curl -I # Create a response header for debugging using curl -I
setenv.add-response-header = ( "X-Pi-hole" => "The Pi-hole Web interface is working!" ) setenv.add-response-header = (
} "X-Pi-hole" => "The Pi-hole Web interface is working!",
"X-Frame-Options" => "DENY"
# Rewite js requests, must be out of $HTTP block due to bug #2526 )
url.rewrite = ( "^(?!/admin/).*\.js$" => "pihole/index.js" ) $HTTP["url"] =~ ".ttf$" {
# Allow Block Page access to local fonts
# If the URL does not start with /admin, then it is a query for an ad domain setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
$HTTP["url"] =~ "^(?!/admin)/.*" {
# Create a response header for debugging using curl -I
setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." )
}
# Entering just "pi.hole" into a browser redirects to "pi.hole/admin/"
$HTTP["host"] == "pi.hole" {
$HTTP["url"] == "/" {
url.redirect = ( "" => "/admin/" )
} }
} }