ignore return value from fcntl() FD_CLOEXEC
[lighttpd.git] / tests / lighttpd.conf
blob864a28cc0f03b2b38cb7e385187b244c5dc503da
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_status",
29         "mod_expire",
30         "mod_simple_vhost",
31         "mod_redirect",
32         "mod_fastcgi",
33         "mod_cgi",
34         "mod_compress",
35         "mod_userdir",
36         "mod_ssi",
37         "mod_accesslog",
40 server.indexfiles = (
41         "index.php",
42         "index.html",
43         "index.htm",
44         "default.htm",
47 ######################## MODULE CONFIG ############################
49 ssi.extension = (
50         ".shtml",
53 accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
55 mimetype.assign = (
56         ".png"  => "image/png",
57         ".jpg"  => "image/jpeg",
58         ".jpeg" => "image/jpeg",
59         ".gif"  => "image/gif",
60         ".html" => "text/html",
61         ".htm"  => "text/html",
62         ".pdf"  => "application/pdf",
63         ".swf"  => "application/x-shockwave-flash",
64         ".spl"  => "application/futuresplash",
65         ".txt"  => "text/plain",
66         ".tar.gz" =>   "application/x-tgz",
67         ".tgz"  => "application/x-tgz",
68         ".gz"   => "application/x-gzip",
69         ".c"    => "text/plain",
70         ".conf" => "text/plain",
73 $HTTP["host"] == "cache.example.org" {
74         compress.cache-dir = env.SRCDIR + "/tmp/lighttpd/cache/compress/"
76 compress.filetype = (
77         "text/plain",
78         "text/html",
81 setenv.add-environment = (
82         "TRAC_ENV" => "tracenv",
83         "SETENV" => "setenv",
85 setenv.add-request-header = (
86         "FOO" => "foo",
88 setenv.add-response-header = (
89         "BAR" => "foo",
92 $HTTP["url"] =~ "\.pdf$" {
93         server.range-requests = "disable"
96 fastcgi.debug = 0
97 fastcgi.server = (
98         ".php" => ( (
99                 "host" => "127.0.0.1",
100                 "port" => 1026,
101                 "broken-scriptfilename" => "enable",
102                 "allow-x-send-file" => "enable",
103         ) ),
104         "/prefix.fcgi" => ( (
105                 "host" => "127.0.0.1",
106                 "port" => 1026,
107                 "check-local" => "disable",
108                 "broken-scriptfilename" => "enable",
109         ) ),
112 cgi.assign = (
113         ".pl"  => env.PERL,
114         ".cgi" => env.PERL,
117 userdir.include-user = (
118         "jan",
120 userdir.path = "/"
122 $HTTP["host"] == "auth-htpasswd.example.org" {
123         auth.backend = "htpasswd"
126 auth.backend = "plain"
127 auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
129 auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
131 auth.require = (
132         "/server-status" => (
133                 "method"  => "digest",
134                 "realm"   => "download archiv",
135                 "require" => "group=www|user=jan|host=192.168.2.10",
136         ),
137         "/server-config" => (
138                 "method"  => "basic",
139                 "realm"   => "download archiv",
140                 "require" => "valid-user",
141         ),
144 url.access-deny = (
145         "~",
146         ".inc",
149 url.rewrite = (
150         "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1",
151         "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1",
154 url.rewrite-if-not-file = (
155         "^(/rewrite/[^?]*)(?:\?(.*))?$" => "/indexfile/rewrite.php?file=$1&$2",
158 expire.url = (
159         "/expire/access" => "access 2 hours",
160         "/expire/modification" => "access plus 1 seconds 2 minutes",
163 #### status module
164 status.status-url = "/server-status"
165 status.config-url = "/server-config"
167 $HTTP["host"] == "vvv.example.org" {
168         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
169         secdownload.secret          = "verysecret"
170         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
171         secdownload.uri-prefix      = "/sec/"
172         secdownload.timeout         = 120
173         secdownload.algorithm       = "md5"
176 $HTTP["host"] == "vvv-sha1.example.org" {
177         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
178         secdownload.secret          = "verysecret"
179         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
180         secdownload.uri-prefix      = "/sec/"
181         secdownload.timeout         = 120
182         secdownload.algorithm       = "hmac-sha1"
185 $HTTP["host"] == "vvv-sha256.example.org" {
186         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
187         secdownload.secret          = "verysecret"
188         secdownload.document-root   = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
189         secdownload.uri-prefix      = "/sec/"
190         secdownload.timeout         = 120
191         secdownload.algorithm       = "hmac-sha256"
194 $HTTP["host"] == "zzz.example.org" {
195         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
196         server.name = "zzz.example.org"
197         static-file.disable-pathinfo = "enable"
200 $HTTP["host"] == "symlink.example.org" {
201         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
202         server.name = "symlink.example.org"
203         server.follow-symlink = "enable"
206 $HTTP["host"] == "nosymlink.example.org" {
207         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
208         server.name = "symlink.example.org"
209         server.follow-symlink = "disable"
212 $HTTP["host"] == "no-simple.example.org" {
213         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/123.example.org/pages/"
214         server.name = "zzz.example.org"
217 $HTTP["host"] !~ "(no-simple\.example\.org)" {
218         simple-vhost.document-root  = "pages"
219         simple-vhost.server-root    = env.SRCDIR + "/tmp/lighttpd/servers/"
220         simple-vhost.default-host   = "www.example.org"
223 $HTTP["host"] == "auth.example.org" {
224         server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
225         server.name = "auth.example.org"
226         auth.backend = "htpasswd"
227         auth.require = (
228                 "" => (
229                         "method"  => "basic",
230                         "realm"   => "download archiv",
231                         "require" => "valid-user",
232                 ),
233         )
236 $HTTP["host"] =~ "(vvv).example.org" {
237         url.redirect = (
238                 "^/redirect/$" => "http://localhost:2048/",
239         )
242 $HTTP["host"] =~ "(zzz).example.org" {
243         url.redirect = (
244                 "^/redirect/$" => "http://localhost:2048/%1",
245         )
248 $HTTP["host"] =~ "(remoteip)\.example\.org" {
249         $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
250                 url.redirect = (
251                         "^/redirect/$" => "http://localhost:2048/%1",
252                 )
253         }
256 $HTTP["remoteip"] =~ "(127\.0\.0\.1)" {
257         $HTTP["host"] =~ "(remoteip2)\.example\.org" {
258                 url.redirect = (
259                         "^/redirect/$" => "http://localhost:2048/%1",
260                 )
261         }
264 $HTTP["host"] =~ "bug255\.example\.org$" {
265         $HTTP["remoteip"] == "127.0.0.1" {
266                 url.access-deny = (
267                         "",
268                 )
269         }
272 $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
273         url.access-deny = (
274                 ".jpg",
275         )
278 # deny access for all image stealers
279 $HTTP["host"] == "referer.example.org" {
280         $HTTP["referer"] !~ "^($|http://referer\.example\.org)" {
281                 url.access-deny = (
282                         ".png",
283                 )
284         }
287 $HTTP["cookie"] =~ "empty-ref" {
288         $HTTP["referer"] == "" {
289                 url.access-deny = (
290                         "",
291                 )
292         }
295 $HTTP["host"] =~ "allow\.example\.org$" {
296         url.access-allow = ( ".txt" ) # allow takes precedence over deny
297         url.access-deny = ( ".txt" )
300 $HTTP["host"] == "etag.example.org" {
301         static-file.etags = "disable"
302         compress.filetype = ()