summaryrefslogtreecommitdiff
path: root/tests/lighttpd.conf
blob: 21f80110672b62ad244ea1bed176c61b7d5daebb (plain) (blame)
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
server.modules += (
	"mod_proxy",
	"mod_accesslog",
)

server.bind          = var.CWD + "/lighttpd.socket"
server.document-root = var.CWD + "/src/static/"

server.errorlog    = "/dev/stderr"
server.breakagelog = "/dev/stderr"
accesslog.filename = "/dev/stderr"

accesslog.format  = ""
accesslog.format += "{ "
accesslog.format +=    "\"tool\": "            + "\"lighttpd\", "
accesslog.format +=    "\"http-host\": "       + "\"%V\", "
accesslog.format +=    "\"remote-addr\": "     + "\"%h\", "
accesslog.format +=    "\"remote-user\": "     + "\"%u\", "
accesslog.format +=    "\"request-method\": "  + "\"%m\", "
accesslog.format +=    "\"request\": "         + "\"%r\", "
accesslog.format +=    "\"status\": "          +  "%s, "
accesslog.format +=    "\"body-bytes-sent\": " + "\"%b\", "
accesslog.format +=    "\"duration-usec\": "   +  "%D, "
accesslog.format +=    "\"http-referrer\": "   + "\"%{Referer}i\", "
accesslog.format +=    "\"http-user-agent\": " + "\"%{User-Agent}i\" "
accesslog.format += "}"

index-file.names = ( "index.html" )

$HTTP["url"] =~ "^/api/" {
	proxy.server = ( "" => (( "host" => var.CWD + "/web.socket" )))
	$HTTP["url"] =~ "^/api/socket$" {
		proxy.header += ( "upgrade" => "enable" )
	}
}