lighttpd.conf 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. server.modules = (
  2. "mod_access",
  3. "mod_cgi",
  4. "mod_accesslog",
  5. "mod_rewrite",
  6. "mod_alias",
  7. "mod_auth",
  8. "mod_setenv",
  9. # "mod_status",
  10. # "mod_debug"
  11. )
  12. server.document-root = "/www/htdocs"
  13. server.upload-dirs = ( "/www/tmp" )
  14. server.errorlog = "/www/log/error.log"
  15. accesslog.filename = "/www/log/access.log"
  16. server.pid-file = "/var/run/lighttpd.pid"
  17. server.username = "httpd"
  18. server.groupname = "nogroup"
  19. server.port = 80
  20. dir-listing.activate = "enable"
  21. dir-listing.hide-dotfiles = "enable"
  22. #debug.log-request-handling = "enable"
  23. #debug.log-request-header = "enable"
  24. #debug.log-file-not-found = "enable"
  25. #debug.log-request-header-on-error = "enable"
  26. #debug.log-response-header = "enable"
  27. #debug.log-condition-handling = "enable"
  28. #auth.debug = 2
  29. #setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
  30. index-file.names = (
  31. "index.html",
  32. "default.html"
  33. )
  34. cgi.assign = (
  35. ".sh" => "/bin/bash",
  36. ".cgi" => "",
  37. )
  38. url.access-deny = ( "~", ".inc", ".htaccess", ".htpasswd", "htpasswd", "/tmp/" )
  39. auth.backend = "htdigest"
  40. auth.backend.htdigest.userfile = "/opt/lib/htpasswd"
  41. #auth.require = (
  42. # "/admin" => (
  43. # "method" => "digest",
  44. # "realm" => "superglue",
  45. # "require" => "valid-user"
  46. # ),
  47. # "/log" => (
  48. # "method" => "digest",
  49. # "realm" => "superglue",
  50. # "require" => "valid-user"
  51. # ),
  52. # "/server-status" => (
  53. # "method" => "digest",
  54. # "realm" => "superglue",
  55. # "require" => "valid-user"
  56. # )
  57. #)
  58. $HTTP["url"] =~ "^/admin$|^/admin/(.*)|^/log/(.*)$" {
  59. auth.require = ( "" => (
  60. "method" => "digest",
  61. "realm" => "superglue",
  62. "require" => "valid-user"
  63. )
  64. )
  65. }
  66. $HTTP["request-method"] == "GET" {
  67. url.rewrite = (
  68. "^/resources/(.*)$" => "resources/$1",
  69. "^/devTools/(.*)$" => "devTools/$1",
  70. "^/templates/(.*)$" => "templates/$1",
  71. "^/extension/(.*)$" => "extension/$1"
  72. ),
  73. alias.url = (
  74. "/resources" => "/opt/lib/resources",
  75. "/devTools" => "/opt/lib/devTools",
  76. "/templates" => "/opt/lib/templates",
  77. "/admin" => "/opt/lib/cgi/admin2.cgi",
  78. "/extension" => "/opt/lib/extension"
  79. )
  80. ## override content and mime type for dotless files to text/html
  81. $HTTP["url"] !~ "(\.)" {
  82. setenv.add-response-header += (
  83. "X-Superglue-Dotless" => "text/html Content-Type was forced",
  84. "Content-Type" => "text/html"
  85. )
  86. }
  87. }
  88. $HTTP["request-method"] == "POST" {
  89. alias.url = (
  90. "/admin" => "/opt/lib/cgi/admin2.cgi",
  91. "" => "/opt/lib/cgi/post.cgi"
  92. )
  93. auth.require = (
  94. "" => (
  95. "method" => "digest",
  96. "realm" => "superglue",
  97. "require" => "valid-user"
  98. )
  99. )
  100. }
  101. ## can use this? per
  102. ## https://dev.openwrt.org/browser/packages/net/lighttpd/files/lighttpd.conf?rev=38469
  103. # include_shell "cat /etc/lighttpd/conf.d/*.conf"
  104. ## reads optional conf files
  105. include_shell "/etc/lighttpd/opts.sh mime.conf compress.conf"
  106. ## defines var.superglueVersion from /etc/superglue_version
  107. include_shell "/etc/lighttpd/vars.sh"
  108. setenv.add-response-header = ( "X-Superglue-Version" => var.superglueVersion )