123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- server.modules = (
- "mod_access",
- "mod_cgi",
- "mod_accesslog",
- "mod_rewrite",
- "mod_alias",
- "mod_auth",
- "mod_setenv",
- "mod_proxy",
- # "mod_status",
- # "mod_debug"
- )
- server.document-root = "/www/htdocs"
- server.upload-dirs = ( "/www/tmp" )
- server.errorlog = "/www/log/error.log"
- accesslog.filename = "/www/log/access.log"
- server.pid-file = "/var/run/lighttpd.pid"
- server.username = "httpd"
- server.groupname = "nogroup"
- server.port = 80
- dir-listing.activate = "enable"
- dir-listing.hide-dotfiles = "enable"
- #debug.log-request-handling = "enable"
- #debug.log-request-header = "enable"
- #debug.log-file-not-found = "enable"
- #debug.log-request-header-on-error = "enable"
- #debug.log-response-header = "enable"
- #debug.log-condition-handling = "enable"
- #auth.debug = 2
- #setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
- index-file.names = (
- "index.html",
- "default.html"
- )
- cgi.assign = (
- ".sh" => "/bin/bash",
- ".cgi" => "",
- )
- url.access-deny = ( "~", ".inc", ".htaccess", ".htpasswd", "htpasswd", "/tmp/" )
- auth.backend = "htdigest"
- auth.backend.htdigest.userfile = "/opt/lib/htpasswd"
- $HTTP["url"] =~ "^/admin$|^/admin/(.*)|^/log/(.*)$" {
- auth.require = ( "" => (
- "method" => "digest",
- "realm" => "superglue",
- "require" => "valid-user"
- )
- )
- }
- $HTTP["request-method"] == "POST" {
- auth.require = ( "" => (
- "method" => "digest",
- "realm" => "superglue",
- "require" => "valid-user"
- )
- )
- }
- $HTTP["request-method"] == "GET" {
- url.rewrite = (
- "^/resources/(.*)$" => "resources/$1",
- "^/devTools/(.*)$" => "devTools/$1",
- "^/templates/(.*)$" => "templates/$1",
- "^/extension/(.*)$" => "extension/$1"
- ),
- alias.url = (
- "/resources" => "/opt/lib/resources",
- "/devTools" => "/opt/lib/devTools",
- "/templates" => "/opt/lib/templates",
- "/extension" => "/opt/lib/extension"
- )
- ## override content and mime type for dotless files to text/html
- $HTTP["url"] !~ "(\.)" {
- $HTTP["url"] !~ "(^/admin)" {
- setenv.add-response-header += (
- "X-Superglue-Dotless" => "text/html Content-Type was forced",
- "Content-Type" => "text/html"
- )
- }
- }
- }
- $HTTP["url"] =~ "(^/admin)" {
- proxy.server = ( "" => ("admin" => ( "host" => "127.0.0.1", "port" => 81 )))
- }
- $HTTP["request-method"] == "POST" {
- alias.url = (
- "" => "/opt/lib/cgi/post.cgi"
- )
- }
- ## can use this? per
- ## https://dev.openwrt.org/browser/packages/net/lighttpd/files/lighttpd.conf?rev=38469
- # include_shell "cat /etc/lighttpd/conf.d/*.conf"
- ## reads optional conf files
- include_shell "/etc/lighttpd/opts.sh mime.conf compress.conf"
- ## defines var.superglueVersion from /etc/superglue_version
- include_shell "/etc/lighttpd/vars.sh"
- setenv.add-response-header = ( "X-Superglue-Version" => var.superglueVersion )
|