mirror of
https://github.com/moparisthebest/pi-hole
synced 2024-12-23 07:38:50 -05:00
Merge pull request #62 from jacobsalmela/lighttpd
New lighttpd.conf. Closes #31 and #50
This commit is contained in:
commit
2f9e650739
@ -2,10 +2,12 @@ server.modules = (
|
|||||||
"mod_expire",
|
"mod_expire",
|
||||||
"mod_compress",
|
"mod_compress",
|
||||||
"mod_redirect",
|
"mod_redirect",
|
||||||
|
"mod_setenv",
|
||||||
"mod_rewrite"
|
"mod_rewrite"
|
||||||
)
|
)
|
||||||
|
|
||||||
server.document-root = "/var/www"
|
server.document-root = "/var/www/html"
|
||||||
|
server.error-handler-404 = "pihole/index.html"
|
||||||
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
|
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
|
||||||
server.errorlog = "/var/log/lighttpd/error.log"
|
server.errorlog = "/var/log/lighttpd/error.log"
|
||||||
server.pid-file = "/var/run/lighttpd.pid"
|
server.pid-file = "/var/run/lighttpd.pid"
|
||||||
@ -26,13 +28,20 @@ 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"
|
||||||
|
|
||||||
# Set access to 1 day for better query performance when the list gets so large
|
# If the URL starts with /admin, it is the Web interface
|
||||||
# http://jacobsalmela.com/raspberry-pi-block-ads-adtrap/#comment-2013820434
|
$HTTP["url"] =~ "^/admin/" {
|
||||||
$HTTP["url"] =~ "^/pihole/" {
|
# Create a response header for debugging using curl -I
|
||||||
expire.url = ("" => "access plus 1 days")
|
setenv.add-response-header = ( "X-Pi-hole" => "The Pi-hole Web interface is working!" )
|
||||||
}
|
}
|
||||||
|
|
||||||
# Rewrites all URLs to the /var/www/pihole/index.html
|
# If the URL does not start with /admin, then it is a query for an ad domain
|
||||||
$HTTP["host"] =~ ".*" {
|
$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." )
|
||||||
|
|
||||||
|
# Set the cache to 1 day for better performance
|
||||||
|
expire.url = ("" => "access plus 1 days")
|
||||||
|
|
||||||
|
# Send the query into the black hole
|
||||||
url.rewrite = (".*" => "pihole/index.html" )
|
url.rewrite = (".*" => "pihole/index.html" )
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user