Guest User

Untitled

a guest
Aug 8th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  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_auth",
  22. "mod_expire",
  23. "mod_compress",
  24. "mod_redirect",
  25. "mod_setenv",
  26. "mod_rewrite"
  27. )
  28.  
  29. server.document-root = "/var/www/html"
  30. server.error-handler-404 = "pihole/index.php"
  31. server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
  32. server.errorlog = "/var/log/lighttpd/error.log"
  33. server.pid-file = "/var/run/lighttpd.pid"
  34. server.username = "www-data"
  35. server.groupname = "www-data"
  36. server.port = 80
  37. accesslog.filename = "/var/log/lighttpd/access.log"
  38. accesslog.format = "%{%s}t|%V|%r|%s|%b"
  39.  
  40. index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
  41. url.access-deny = ( "~", ".inc", ".md", ".yml", ".ini" )
  42. static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
  43.  
  44. compress.cache-dir = "/var/cache/lighttpd/compress/"
  45. compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
  46.  
  47. # default listening port for IPv6 falls back to the IPv4 port
  48. include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
  49. include_shell "/usr/share/lighttpd/create-mime.assign.pl"
  50.  
  51. # Prevent Lighttpd from enabling Let's Encrypt SSL for every blocked domain
  52. #include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
  53. include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"\n' 2>/dev/null"
  54.  
  55. # If the URL starts with /admin, it is the Web interface
  56. $HTTP["url"] =~ "^/admin/" {
  57. # Create a response header for debugging using curl -I
  58. setenv.add-response-header = (
  59. "X-Pi-hole" => "The Pi-hole Web interface is working!",
  60. "X-Frame-Options" => "DENY"
  61. )
  62.  
  63. $HTTP["url"] =~ ".ttf$" {
  64. # Allow Block Page access to local fonts
  65. setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
  66. }
  67. }
  68.  
  69. # Block . files from being served, such as .git, .github, .gitignore
  70. $HTTP["url"] =~ "^/admin/\.(.*)" {
  71. url.access-deny = ("")
  72. }
  73.  
  74. # Add user chosen options held in external file
  75. include_shell "cat external.conf 2>/dev/null"
Advertisement
Add Comment
Please, Sign In to add comment