Advertisement
Guest User

Untitled

a guest
Jul 4th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. pi@piHole:/var/www/html/admin $ cat /etc/lighttpd/lighttpd.conf
  2. # Pi-hole: A black hole for Internet advertisements
  3. # (c) 2015, 2016 by Jacob Salmela
  4. # Network-wide ad blocking via your Raspberry Pi
  5. # http://pi-hole.net
  6. # lighttpd config for Pi-hole
  7. #
  8. # Pi-hole is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 2 of the License, or
  11. # (at your option) any later version.
  12.  
  13. server.modules = (
  14. "mod_access",
  15. "mod_accesslog",
  16. "mod_expire",
  17. "mod_compress",
  18. "mod_redirect",
  19. "mod_setenv",
  20. "mod_rewrite"
  21. )
  22.  
  23. server.document-root = "/var/www/html"
  24. server.error-handler-404 = "pihole/index.html"
  25. server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
  26. server.errorlog = "/var/log/lighttpd/error.log"
  27. server.pid-file = "/var/run/lighttpd.pid"
  28. server.username = "www-data"
  29. server.groupname = "www-data"
  30. server.port = 80
  31. accesslog.filename = "/var/log/lighttpd/access.log"
  32. accesslog.format = "%{%s}t|%V|%r|%s|%b"
  33.  
  34.  
  35. index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
  36. url.access-deny = ( "~", ".inc" )
  37. static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
  38.  
  39. compress.cache-dir = "/var/cache/lighttpd/compress/"
  40. compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
  41.  
  42. # default listening port for IPv6 falls back to the IPv4 port
  43. include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
  44. include_shell "/usr/share/lighttpd/create-mime.assign.pl"
  45. include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
  46.  
  47.  
  48.  
  49. # If the URL starts with /admin, it is the Web interface
  50. $HTTP["url"] =~ "^/admin/" {
  51. # Create a response header for debugging using curl -I
  52. setenv.add-response-header = (
  53. "X-Pi-hole" => "The Pi-hole Web interface is working!",
  54. "X-Frame-Options" => "DENY"
  55. )
  56. url.rewrite-if-not-file = ( "(?!\.\w+$)" => "admin/index.html" )
  57. }
  58.  
  59. $HTTP["url"] =~ "^/adminNG/" {
  60. # Create a response header for debugging using curl -I
  61. setenv.add-response-header = (
  62. "X-Pi-hole" => "The Pi-hole Web interface is working!",
  63. "X-Frame-Options" => "DENY"
  64. )
  65. url.rewrite-if-not-file = ( "(?!\.\w+$)" => "adminNG/index.html" )
  66. }
  67.  
  68.  
  69. # If the URL does not start with /admin, then it is a query for an ad domain
  70. $HTTP["url"] =~ "^(?!/admin)/.*" {
  71. # Create a response header for debugging using curl -I
  72. setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." )
  73. # rewrite only js requests
  74. url.rewrite = ("(.*).js" => "pihole/index.js")
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement