####################################################################### ## ## For more examples check: ## ## http://www.lighttpd.net/documentation/configuration.html#conditional-configuration ## ## /usr/local/etc/lighttpd/hgauth/hgaccess.txt $HTTP["host"] == "hg.hedgewars.org" { var.server_name = "hg.hedgewars.org" server.name = server_name accesslog.filename = log_root + "/" + server_name + "/access.log" $HTTP["request-method"] != "GET" { $HTTP["url"] =~ ".*hedgewars-draft.*" { auth.backend = "plain" auth.backend.plain.userfile = "/usr/local/etc/lighttpd/hgauth/draftaccess.txt" auth.require = ( "" => ( "method" => "digest", # "method" => "basic", "realm" => "hedgewars repositories", "require" => "valid-user" ) ) } $HTTP["url"] !~ ".*hedgewars-draft.*" { auth.backend = "plain" auth.backend.plain.userfile = "/usr/local/etc/lighttpd/hgauth/hgaccess.txt" auth.require = ( "" => ( "method" => "digest", # "method" => "basic", "realm" => "hedgewars repositories", "require" => "valid-user" ) ) } } # covenience redirect as long as there is only a single repo anyway # make sure mod_redirect is enabled in modules.conf #$HTTP["url"] == "/" { #url.redirect = ( ".*" => "/hedgewars" ) #url.redirect-code = 302 #} $HTTP["url"] !~ "^/\.well-known/.*$" { # the cgi still supplies links to css files as if there was no rewrite $HTTP["url"] !~ "^/hgweb.fcgi/" { url.rewrite-once = ("^/(.*)$" => "/hgweb.fcgi/$1") } } fastcgi.server += ( "hgweb.fcgi" => ( ( "bin-path" => "/usr/local/www/hg.hedgewars.org/hgweb.fcgi", "socket" => "/usr/local/www/hg.hedgewars.org/hgweb.fcgi.sock", "min-procs" => 1, "max-procs" => 4 ) ) ) # "check-local" => "disable", # "fix-root-scriptname" => "enable", } ## #######################################################################