[core] consolidate duplicated read-to-close code
[lighttpd.git] / tests / lighttpd.conf
blobed4ff37064b79486a25837018fc0039f616a2373
1 debug.log-request-handling = "enable"
2 debug.log-request-header = "enable"
3 debug.log-response-header = "enable"
4 #debug.log-condition-handling = "enable"
5 server.document-root         = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
7 ## 64 Mbyte ... nice limit
8 server.max-request-size = 65000
10 ## bind to port (default: 80)
11 server.port                 = 2048
13 ## bind to localhost (default: all interfaces)
14 server.bind                = "localhost"
15 server.errorlog            = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
16 server.breakagelog         = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
17 server.name                = "www.example.org"
18 server.tag                 = "Apache 1.3.29"
20 server.dir-listing          = "enable"
22 server.modules = (
23         "mod_rewrite",
24         "mod_setenv",
25         "mod_secdownload",
26         "mod_access",
27         "mod_auth",
28         "mod_authn_file",
29         "mod_status",
30         "mod_expire",
31         "mod_simple_vhost",
32         "mod_redirect",
33         "mod_fastcgi",
34         "mod_cgi",
35         "mod_compress",
36         "mod_userdir",
37         "mod_ssi",
38         "mod_accesslog",
41 server.indexfiles = (
42         "index.php",
43         "index.html",
44         "index.htm",
45         "default.htm",
48 ######################## MODULE CONFIG ############################
50 ssi.extension = (
51         ".shtml",
54 accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
56 mimetype.assign = (
57         ".png"  => "image/png",
58         ".jpg"  => "image/jpeg",
59         ".jpeg" => "image/jpeg",
60         ".gif"  => "image/gif",
61         ".html" => "text/html",
62         ".htm"  => "text/html",
63         ".pdf"  => "application/pdf",
64         ".swf"  => "application/x-shockwave-flash",
65         ".spl"  => "application/futuresplash",
66         ".txt"  => "text/plain",
67         ".tar.gz" =>   "application/x-tgz",
68         ".tgz"  => "application/x-tgz",
69         ".gz"   => "application/x-gzip",
70         ".c"    => "text/plain",
71         ".conf" => "text/plain",
74 $HTTP["host"] == "cache.example.org" {
75         compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
77 compress.filetype = (
78         "text/plain",
79         "text/html",
82 setenv.add-environment = (
83         "TRAC_ENV" => "tracenv",
84         "SETENV" => "setenv",
86 setenv.add-request-header = (
87         "FOO" => "foo",
89 setenv.add-response-header = (
90         "BAR" => "foo",
93 $HTTP["url"] =~ "\.pdf$" {
94         server.range-requests = "disable"
97 fastcgi.debug = 0
98 fastcgi.server = (
99         ".php" => ( (
100                 "host" => "127.0.0.1",
101                 "port" => 1026,
102                 "broken-scriptfilename" => "enable",
103                 "allow-x-send-file" => "enable",
104         ) ),
105         "/prefix.fcgi" => ( (
106                 "host" => "127.0.0.1",
107                 "port" => 1026,
108                 "check-local" => "disable",
109                 "broken-scriptfilename" => "enable",
110         ) ),
113 cgi.assign = (
114         ".pl"  => env.PERL,
115         ".cgi" => env.PERL,
118 userdir.include-user = (
119         "jan",
121 userdir.path = "/"
123 $HTTP["host"] == "auth-htpasswd.example.org" {
124         auth.backend = "htpasswd"
127 auth.backend = "plain"
128 auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
130 auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
132 auth.require = (
133         "/server-status" => (
134                 "method"  => "digest",
135                 "realm"   => "download archiv",
136                 "require" => "group=www|user=jan|host=192.168.2.10",
137         ),
138         "/server-config" => (
139                 "method"  => "basic",
140                 "realm"   => "download archiv",
141                 "require" => "valid-user",
142         ),
145 url.access-deny = (
146         "~",
147         ".inc",
150 url.rewrite = (
151         "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
152         "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1",
155 url.rewrite-if-not-file = (
156         "^(/rewrite/[^?]*)(?:\?(.*))?$" => "/indexfile/rewrite.php?file=$1&$2",
159 expire.url = (
160         "/expire/access" => "access 2 hours",
161         "/expire/modification" => "access plus 1 seconds 2 minutes",
164 #### status module
165 status.status-url = "/server-status"
166 status.config-url = "/server-config"
168 $HTTP["host"] == "vvv.example.org" {
169         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
170         secdownload.secret          = "verysecret"
171         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
172         secdownload.uri-prefix      = "/sec/"
173         secdownload.timeout         = 120
174         secdownload.algorithm       = "md5"
177 $HTTP["host"] == "vvv-sha1.example.org" {
178         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
179         secdownload.secret          = "verysecret"
180         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
181         secdownload.uri-prefix      = "/sec/"
182         secdownload.timeout         = 120
183         secdownload.algorithm       = "hmac-sha1"
186 $HTTP["host"] == "vvv-sha256.example.org" {
187         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
188         secdownload.secret          = "verysecret"
189         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
190         secdownload.uri-prefix      = "/sec/"
191         secdownload.timeout         = 120
192         secdownload.algorithm       = "hmac-sha256"
195 $HTTP["host"] == "zzz.example.org" {
196         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
197         server.name = "zzz.example.org"
198         static-file.disable-pathinfo = "enable"
201 $HTTP["host"] == "symlink.example.org" {
202         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
203         server.name = "symlink.example.org"
204         server.follow-symlink = "enable"
207 $HTTP["host"] == "nosymlink.example.org" {
208         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
209         server.name = "symlink.example.org"
210         server.follow-symlink = "disable"
213 $HTTP["host"] == "no-simple.example.org" {
214         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/"
215         server.name = "zzz.example.org"
218 $HTTP["host"] !~ "(no-simple\.example\.org)" {
219         simple-vhost.document-root  = "pages"
220         simple-vhost.server-root    = env.SRCDIR + "/tmp/lighttpd/servers/"
221         simple-vhost.default-host   = "www.example.org"
224 $HTTP["host"] == "auth.example.org" {
225         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
226         server.name = "auth.example.org"
227         auth.backend = "htpasswd"
228         auth.require = (
229                 "" => (
230                         "method"  => "basic",
231                         "realm"   => "download archiv",
232                         "require" => "valid-user",
233                 ),
234         )
237 $HTTP["host"] =~ "(vvv).example.org" {
238         url.redirect = (
239                 "^/redirect/$" => "http://localhost:2048/",
240         )
243 $HTTP["host"] =~ "(zzz).example.org" {
244         url.redirect = (
245                 "^/redirect/$" => "http://localhost:2048/%1",
246         )
249 $HTTP["host"] =~ "(remoteip)\.example\.org" {
250         $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
251                 url.redirect = (
252                         "^/redirect/$" => "http://localhost:2048/%1",
253                 )
254         }
257 $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
258         $HTTP["host"] =~ "(remoteip2)\.example\.org" {
259                 url.redirect = (
260                         "^/redirect/$" => "http://localhost:2048/%1",
261                 )
262         }
265 $HTTP["host"] =~ "bug255\.example\.org$" {
266         $HTTP["remoteip"] == "127.0.0.1" {
267                 url.access-deny = (
268                         "",
269                 )
270         }
273 $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
274         url.access-deny = (
275                 ".jpg",
276         )
279 # deny access for all image stealers
280 $HTTP["host"] == "referer.example.org" {
281         $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
282                 url.access-deny = (
283                         ".png",
284                 )
285         }
288 $HTTP["cookie"] =~ "empty-ref" {
289         $HTTP["referer"] == "" {
290                 url.access-deny = (
291                         "",
292                 )
293         }
296 $HTTP["host"] =~ "allow\.example\.org$" {
297         url.access-allow = ( ".txt" ) # allow takes precedence over deny
298         url.access-deny = ( ".txt" )
301 $HTTP["host"] == "etag.example.org" {
302         static-file.etags = "disable"
303         compress.filetype = ()