[core] use con->dst_addr_buf instead of ip recalc
[lighttpd.git] / tests / lighttpd.conf
blob6566d1c85c6b82d4b1c1cb3a38890c66f279f563
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.set-environment = (
87         "NEWENV" => "newenv",
89 setenv.add-request-header = (
90         "FOO" => "foo",
92 setenv.set-request-header = (
93         "FOO2" => "foo2",
95 setenv.add-response-header = (
96         "BAR" => "foo",
98 setenv.set-response-header = (
99         "BAR2" => "bar2",
102 $HTTP["url"] =~ "\.pdf$" {
103         server.range-requests = "disable"
106 fastcgi.debug = 0
107 fastcgi.server = (
108         ".php" => ( (
109                 "host" => "127.0.0.1",
110                 "port" => 1026,
111                 "broken-scriptfilename" => "enable",
112                 "allow-x-send-file" => "enable",
113         ) ),
114         "/prefix.fcgi" => ( (
115                 "host" => "127.0.0.1",
116                 "port" => 1026,
117                 "check-local" => "disable",
118                 "broken-scriptfilename" => "enable",
119         ) ),
122 cgi.local-redir = "enable"
123 cgi.assign = (
124         ".pl"  => env.PERL,
125         ".cgi" => env.PERL,
128 userdir.include-user = (
129         "jan",
131 userdir.path = "/"
133 $HTTP["host"] == "auth-htpasswd.example.org" {
134         auth.backend = "htpasswd"
137 auth.backend = "plain"
138 auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
140 auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
142 auth.require = (
143         "/server-status" => (
144                 "method"  => "digest",
145                 "realm"   => "download archiv",
146                 "require" => "group=www|user=jan|host=192.168.2.10",
147         ),
148         "/server-config" => (
149                 "method"  => "basic",
150                 "realm"   => "download archiv",
151                 "require" => "valid-user",
152         ),
155 url.access-deny = (
156         "~",
157         ".inc",
160 url.rewrite = (
161         "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
162         "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1",
165 url.rewrite-if-not-file = (
166         "^(/rewrite/[^?]*)(?:\?(.*))?$" => "/indexfile/rewrite.php?file=$1&$2",
169 expire.url = (
170         "/expire/access" => "access 2 hours",
171         "/expire/modification" => "access plus 1 seconds 2 minutes",
174 #### status module
175 status.status-url = "/server-status"
176 status.config-url = "/server-config"
178 $HTTP["host"] == "vvv.example.org" {
179         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
180         secdownload.secret          = "verysecret"
181         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
182         secdownload.uri-prefix      = "/sec/"
183         secdownload.timeout         = 120
184         secdownload.algorithm       = "md5"
187 $HTTP["host"] == "vvv-sha1.example.org" {
188         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
189         secdownload.secret          = "verysecret"
190         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
191         secdownload.uri-prefix      = "/sec/"
192         secdownload.timeout         = 120
193         secdownload.algorithm       = "hmac-sha1"
196 $HTTP["host"] == "vvv-sha256.example.org" {
197         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
198         secdownload.secret          = "verysecret"
199         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
200         secdownload.uri-prefix      = "/sec/"
201         secdownload.timeout         = 120
202         secdownload.algorithm       = "hmac-sha256"
203         secdownload.hash-querystr   = "enable"
206 $HTTP["host"] == "zzz.example.org" {
207         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
208         server.name = "zzz.example.org"
209         static-file.disable-pathinfo = "enable"
212 $HTTP["host"] == "symlink.example.org" {
213         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
214         server.name = "symlink.example.org"
215         server.follow-symlink = "enable"
218 $HTTP["host"] == "nosymlink.example.org" {
219         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
220         server.name = "symlink.example.org"
221         server.follow-symlink = "disable"
224 $HTTP["host"] == "no-simple.example.org" {
225         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/"
226         server.name = "zzz.example.org"
229 $HTTP["host"] !~ "(no-simple\.example\.org)" {
230         simple-vhost.document-root  = "pages"
231         simple-vhost.server-root    = env.SRCDIR + "/tmp/lighttpd/servers/"
232         simple-vhost.default-host   = "www.example.org"
235 $HTTP["host"] == "auth.example.org" {
236         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
237         server.name = "auth.example.org"
238         auth.backend = "htpasswd"
239         auth.require = (
240                 "" => (
241                         "method"  => "basic",
242                         "realm"   => "download archiv",
243                         "require" => "valid-user",
244                 ),
245         )
248 $HTTP["host"] =~ "(vvv).example.org" {
249         url.redirect = (
250                 "^/redirect/$" => "http://localhost:2048/",
251         )
254 $HTTP["host"] =~ "(zzz).example.org" {
255         url.redirect = (
256                 "^/redirect/$" => "http://localhost:2048/%1",
257         )
260 $HTTP["host"] =~ "(remoteip)\.example\.org" {
261         $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
262                 url.redirect = (
263                         "^/redirect/$" => "http://localhost:2048/%1",
264                 )
265         }
268 $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
269         $HTTP["host"] =~ "(remoteip2)\.example\.org" {
270                 url.redirect = (
271                         "^/redirect/$" => "http://localhost:2048/%1",
272                 )
273         }
276 $HTTP["host"] =~ "bug255\.example\.org$" {
277         $HTTP["remoteip"] == "127.0.0.1" {
278                 url.access-deny = (
279                         "",
280                 )
281         }
284 $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
285         url.access-deny = (
286                 ".jpg",
287         )
290 # deny access for all image stealers
291 $HTTP["host"] == "referer.example.org" {
292         $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
293                 url.access-deny = (
294                         ".png",
295                 )
296         }
299 $HTTP["cookie"] =~ "empty-ref" {
300         $HTTP["referer"] == "" {
301                 url.access-deny = (
302                         "",
303                 )
304         }
307 $HTTP["host"] =~ "allow\.example\.org$" {
308         url.access-allow = ( ".txt" ) # allow takes precedence over deny
309         url.access-deny = ( ".txt" )
312 $HTTP["host"] == "etag.example.org" {
313         static-file.etags = "disable"
314         compress.filetype = ()