summaryrefslogtreecommitdiff
path: root/lighttpd.conf
blob: 3d546dc29b86a682e7fc3ae61b7ee3bbf0f8e9a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
server.modules = (
  "mod_rewrite",
  "mod_alias",
  "mod_access",
  "mod_setenv",
  "mod_cgi",
  "mod_accesslog"
)

include "mime-types.conf"

server.username      = "lighttpd"
server.groupname     = "lighttpd"
server.pid-file      = "/run/lighttpd.pid"
server.document-root = "/usr/share/gitweb/"
static-file.exclude-extensions = ( ".cgi" )

$HTTP["url"] !~ "^/static" { # gitweb assets (js, css, png)

	dir-listing.activate = "disable"
	cgi.assign = ( ".cgi" => "" )
	$HTTP["url"] =~ "^/.*/(HEAD|info/refs|objects/info/|git-(upload|receive)-pack)" { # git over http
		cgi.assign = ("" => "")
		alias.url += ( "/" => "/usr/libexec/git-core/git-http-backend/" )
		setenv.add-environment = (
			"GIT_PROJECT_ROOT" => "/var/git",
			"GIT_HTTP_EXPORT_ALL" => ""
		)
	}
	else $HTTP["url"] =~ "^/(?!gitweb.cgi)" { # gitweb
		server.indexfiles = ( "gitweb.cgi" )
		alias.url += ( "/" => "/usr/share/gitweb/" )
		url.rewrite-once = ( "^/(.*)" => "/gitweb.cgi/$1" )
	}
}

setenv.add-environment = (
  "GITWEB_CONFIG" => "/etc/gitweb.conf",
  "PATH" => env.PATH
)

#debug.log-request-header   = "enable"
#debug.log-response-header  = "enable"
#debug.log-request-handling = "enable"
#debug.log-file-not-found   = "enable"