File lighttpd.conf of Package pihole-admin-lte
90
1
# Pi-hole: A black hole for Internet advertisements
2
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
3
# Network-wide ad blocking via your own hardware.
4
#
5
# Lighttpd config for Pi-hole
6
#
7
# This file is copyright under the latest version of the EUPL.
8
# Please see LICENSE file for your rights under this license.
9
10
###############################################################################
11
# FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
12
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
13
# #
14
# CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE: #
15
# /etc/lighttpd/external.conf #
16
###############################################################################
17
18
server.modules = (
19
"mod_access",
20
"mod_accesslog",
21
"mod_expire",
22
"mod_compress",
23
"mod_redirect",
24
"mod_setenv",
25
"mod_rewrite",
26
"mod_fastcgi"
27
)
28
29
mimetype.assign = (
30
".html" => "text/html",
31
".txt" => "text/plain",
32
".css" => "text/css",
33
".js" => "application/x-javascript",
34
".jpg" => "image/jpeg",
35
".jpeg" => "image/jpeg",
36
".gif" => "image/gif",
37
".png" => "image/png",
38
".svg" => "image/svg+xml", # thanks to nikke
39
"" => "application/octet-stream"
40
)
41
42
fastcgi.server = (
43
".php" => (
44
"localhost" => (
45
"bin-path" => "/usr/bin/php-cgi -d session.save_path=/run/pihole",
46
"socket" => "/tmp/php-fastcgi.sock",
47
"broken-scriptfilename" => "enable",
48
"max-procs" => 4,
49
"bin-environment" => (
50
"PHP_FCGI_CHILDREN" => "1" # default value
51
)
52
)
53
)
54
)
55
56
server.document-root = "/srv/http/pihole"
57
server.error-handler-404 = "/pihole/index.php"
58
server.username = "http"
59
server.groupname = "http"
60
server.port = 80
61
62
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
63
url.access-deny = ( "~", ".inc", ".md", ".yml", ".ini" )
64
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
65
66
compress.cache-dir = "/var/cache/lighttpd/compress/"
67
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
68
69
# If the URL starts with /admin, it is the Web interface
70
$HTTP["url"] =~ "^/admin/" {
71
# Create a response header for debugging using curl -I
72
setenv.add-response-header = (
73
"X-Pi-hole" => "The Pi-hole Web interface is working!",
74
"X-Frame-Options" => "DENY"
75
)
76
77
$HTTP["url"] =~ ".ttf$" {
78
# Allow Block Page access to local fonts
79
setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
80
}
81
}
82
83
# Block . files from being served, such as .git, .github, .gitignore
84
$HTTP["url"] =~ "^/admin/\.(.*)" {
85
url.access-deny = ("")
86
}
87
88
# Add user chosen options held in external file
89
#include_shell "cat external.conf 2>/dev/null"
90