123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- debug.log-request-handling = "enable"
- debug.log-request-header = "enable"
- debug.log-response-header = "enable"
- #debug.log-condition-handling = "enable"
- ## 64 Mbyte ... nice limit
- server.max-request-size = 65000
- server.systemd-socket-activation = "enable"
- # optional bind spec override, e.g. for platforms without socket activation
- include env.SRCDIR + "/tmp/bind*.conf"
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
- server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
- server.name = "www.example.org"
- server.tag = "lighttpd-1.4.x"
- server.dir-listing = "enable"
- server.modules = (
- "mod_extforward",
- "mod_auth",
- "mod_authn_file",
- "mod_setenv",
- "mod_access",
- "mod_expire",
- "mod_simple_vhost",
- "mod_cgi",
- "mod_status",
- "mod_secdownload",
- "mod_deflate",
- "mod_accesslog",
- )
- index-file.names = (
- "index.html",
- )
- accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
- mimetype.assign = (
- ".png" => "image/png",
- ".jpg" => "image/jpeg",
- ".jpeg" => "image/jpeg",
- ".gif" => "image/gif",
- ".html" => "text/html",
- ".htm" => "text/html",
- ".pdf" => "application/pdf",
- ".swf" => "application/x-shockwave-flash",
- ".spl" => "application/futuresplash",
- ".txt" => "text/plain",
- ".tar.gz" => "application/x-tgz",
- ".tgz" => "application/x-tgz",
- ".gz" => "application/x-gzip",
- ".c" => "text/plain",
- ".conf" => "text/plain",
- )
- setenv.add-environment = (
- "TRAC_ENV" => "tracenv",
- "SETENV" => "setenv",
- )
- setenv.set-environment = (
- "NEWENV" => "newenv",
- )
- setenv.add-request-header = (
- "FOO" => "foo",
- )
- setenv.set-request-header = (
- "FOO2" => "foo2",
- )
- setenv.add-response-header = (
- "BAR" => "foo",
- )
- setenv.set-response-header = (
- "BAR2" => "bar2",
- )
- $HTTP["url"] =~ "\.pdf$" {
- server.range-requests = "disable"
- }
- cgi.local-redir = "enable"
- cgi.assign = (
- ".pl" => env.PERL,
- ".cgi" => env.PERL,
- )
- extforward.headers = ( "Forwarded", "X-Forwarded-For" )
- extforward.forwarder = (
- "127.0.0.1" => "trust",
- "127.0.30.1" => "trust",
- )
- url.access-deny = (
- "~",
- ".inc",
- )
- expire.url = (
- "/expire/access" => "access 2 hours",
- "/expire/modification" => "access plus 1 seconds 2 minutes",
- )
- $HTTP["host"] == "symlink.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- server.follow-symlink = "enable"
- }
- $HTTP["host"] == "nosymlink.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- server.follow-symlink = "disable"
- }
- $HTTP["host"] == "no-simple.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/"
- }
- else {
- simple-vhost.document-root = "pages"
- simple-vhost.server-root = env.SRCDIR + "/tmp/lighttpd/servers/"
- simple-vhost.default-host = "www.example.org"
- }
- $HTTP["host"] =~ "bug255\.example\.org$" {
- $HTTP["remoteip"] == "127.0.0.1" {
- url.access-deny = (
- "",
- )
- }
- }
- $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
- url.access-deny = (
- ".jpg",
- )
- }
- # deny access for all image stealers
- $HTTP["host"] == "referer.example.org" {
- $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
- url.access-deny = (
- ".png",
- )
- }
- }
- $HTTP["cookie"] =~ "empty-ref" {
- $HTTP["referer"] == "" {
- url.access-deny = (
- "",
- )
- }
- }
- $HTTP["host"] =~ "allow\.example\.org$" {
- url.access-allow = ( ".txt" ) # allow takes precedence over deny
- url.access-deny = ( ".txt" )
- }
- $HTTP["host"] == "cgi.example.org" {
- cgi.x-sendfile = "enable"
- }
- $HTTP["host"] == "errors.example.org" {
- $HTTP["url"] =~ "^/static/" {
- server.error-handler-404 = "/404.html"
- }
- else $HTTP["url"] =~ "^/dynamic/redirect_status/" {
- server.error-handler = "/404.pl"
- }
- else {
- server.error-handler-404 = "/404.pl"
- }
- }
- $HTTP["host"] == "lowercase-allow" {
- server.force-lowercase-filenames = "enable"
- }
- $HTTP["host"] == "lowercase-deny" {
- server.force-lowercase-filenames = "enable"
- url.access-deny = (
- ".jpg",
- )
- }
- $HTTP["host"] == "lowercase-exclude" {
- server.force-lowercase-filenames = "enable"
- static-file.exclude-extensions = (
- ".jpg",
- )
- }
- $HTTP["host"] == "lowercase-auth" {
- server.force-lowercase-filenames = "enable"
- auth.backend = "plain"
- auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
- auth.require = (
- "/image.jpg" => (
- "method" => "digest",
- "realm" => "download archiv",
- "require" => "valid-user",
- ),
- )
- }
- $HTTP["host"] =~ "^deflate(?:-cache)?\.example\.org$" {
- $HTTP["url"] == "/index.txt" {
- # (force Content-Type for test; do not copy)
- setenv.set-response-header = (
- "Content-Type" => "text/plain; charset=utf-8"
- )
- }
- deflate.mimetypes = (
- "text/plain",
- "text/html",
- )
- deflate.allowed-encodings = (
- "gzip",
- "deflate",
- )
- $HTTP["host"] == "deflate-cache.example.org" {
- deflate.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
- }
- }
- $HTTP["host"] =~ "^auth-" {
- $HTTP["host"] == "auth-htpasswd.example.org" {
- auth.backend = "htpasswd"
- auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
- }
- $HTTP["host"] == "auth-plain.example.org" {
- auth.backend = "plain"
- auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
- }
- auth.require = (
- "/server-status" => (
- "method" => "digest",
- "realm" => "download archiv",
- "require" => "group=www|user=jan|host=192.168.2.10",
- ),
- "/server-config" => (
- "method" => "basic",
- "realm" => "download archiv",
- "require" => "valid-user",
- ),
- )
- status.status-url = "/server-status"
- status.config-url = "/server-config"
- }
- $HTTP["host"] == "vvv.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- secdownload.secret = "verysecret"
- secdownload.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- secdownload.uri-prefix = "/sec/"
- secdownload.timeout = 120
- secdownload.algorithm = "md5"
- }
- $HTTP["host"] == "vvv-sha1.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- secdownload.secret = "verysecret"
- secdownload.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- secdownload.uri-prefix = "/sec/"
- secdownload.timeout = 120
- secdownload.algorithm = "hmac-sha1"
- }
- $HTTP["host"] == "vvv-sha256.example.org" {
- server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- secdownload.secret = "verysecret"
- secdownload.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
- secdownload.uri-prefix = "/sec/"
- secdownload.timeout = 120
- secdownload.algorithm = "hmac-sha256"
- secdownload.hash-querystr = "enable"
- }
|