summaryrefslogtreecommitdiff
path: root/tests/lighttpd.conf
blob: 83bdf65603561e5d0ea1a8bd8f63c9c92c771e78 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
server.document-root         = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.pid-file              = env.SRCDIR + "/tmp/lighttpd/lighttpd.pid"
server.tag = "Apache 1.3.29"

debug.log-request-handling = "enable"
debug.log-response-header = "enable"
## 64 Mbyte ... nice limit
server.max-request-size = 65000

include "default.conf"

setenv.add-request-header   = ( "FOO" => "foo")
setenv.add-response-header  = ( "BAR" => "foo")

$HTTP["host"] == "cache.example.org" {
  compress.cache-dir          = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
}

$HTTP["url"] =~ "\.pdf$" {
  server.range-requests = "disable"
}

#fastcgi.debug               = 0
#fastcgi.server              = ( ".php" =>        ( ( "host" => "127.0.0.1", "port" => 1026, "broken-scriptfilename" => "enable" ) ),
#			        "/prefix.fcgi" => ( ( "host" => "127.0.0.1", "port" => 1026, "check-local" => "disable", "broken-scriptfilename" => "enable" ) )
#			      )
		
$HTTP["host"] == "auth-htpasswd.example.org" {
	auth.backend                = "htpasswd"
}

$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
}

$HTTP["host"] == "zzz.example.org" {
  server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  server.name = "zzz.example.org"
}

$HTTP["host"] == "symlink.example.org" {
  server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  server.name = "symlink.example.org"
  server.follow-symlink = "enable"
}

$HTTP["host"] == "nosymlink.example.org" {
  server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  server.name = "symlink.example.org"
  server.follow-symlink = "disable"
}

$HTTP["host"] == "no-simple.example.org" {
  server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/"
  server.name = "zzz.example.org"
}

$HTTP["host"] !~ "(no-simple\.example\.org)" {
  simple-vhost.document-root  = "pages"
  simple-vhost.server-root    = env.SRCDIR + "/tmp/lighttpd/servers/"
  simple-vhost.default-host   = "www.example.org"
}

$HTTP["host"] =~ "(vvv).example.org" {
  url.redirect = ( "^/redirect/$" => "http://localhost:2048/" )
}

$HTTP["host"] =~ "(zzz).example.org" {
  url.redirect = ( "^/redirect/$" => "http://localhost:2048/%1" )
}

$HTTP["host"] =~ "(remoteip)\.example\.org" {
  $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
    url.redirect = ( "^/redirect/$" => "http://localhost:2048/%1" )
  }
}

$HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
  $HTTP["host"] =~ "(remoteip2)\.example\.org" {
    url.redirect = ( "^/redirect/$" => "http://localhost:2048/%1" )
  }
}

$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 = ( "" )
  }
}