forked from lpereira/lwan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testrunner.conf
105 lines (98 loc) · 2.85 KB
/
testrunner.conf
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
# Timeout in seconds to keep a connection alive.
keep_alive_timeout = 15
# Set to true to not print any debugging messages. (Only effective in
# release builds.)
quiet = false
# Set SO_REUSEPORT=1 in the master socket.
reuse_port = false
# Value of "Expires" header. Default is 1 month and 1 week.
expires = 1M 1w
# Number of I/O threads. Default (0) is number of online CPUs.
threads = 0
# This flag is enabled here so that the automated tests can be executed
# properly, but should be disabled unless absolutely needed (an example
# would be haproxy).
proxy_protocol = true
listener *:8080 {
prefix /hello {
handler = hello_world
}
prefix /quit-lwan {
handler = quit_lwan
}
prefix /proxy {
handler = test_proxy
}
prefix /chunked {
handler = test_chunked_encoding
}
prefix /sse {
handler = test_server_sent_event
}
prefix /beacon {
handler = gif_beacon
}
prefix /favicon.ico {
handler = gif_beacon
}
prefix /post {
handler = test_post
}
redirect /elsewhere {
to = http://lwan.ws
}
prefix /admin {
handler = hello_world
authorization basic {
realm = Administration Page
password file = htpasswd
}
}
lua /inline {
default type = text/html
cache period = 30s
script = '''
function handle_get_root(req)
req:say('Hello')
end
'''
}
lua /lua {
default type = text/html
script file = test.lua
cache period = 30s
}
rewrite /pattern {
pattern foo/(%d+)(%a)(%d+) {
redirect to = /hello?name=pre%2middle%3othermiddle%1post
}
pattern bar/(%d+)/test {
rewrite as = /hello?name=rewritten%1
}
pattern lua/redir/(%d+)x(%d+) {
expand_with_lua = true
redirect to = '''
function handle_rewrite(req, captures)
local r = captures[1] * captures[2]
return '/hello?name=redirected' .. r
end
'''
}
pattern lua/rewrite/(%d+)x(%d+) {
expand_with_lua = true
rewrite as = '''
function handle_rewrite(req, captures)
local r = captures[1] * captures[2]
return '/hello?name=rewritten' .. r
end
'''
}
}
serve_files / {
path = ./wwwroot
# When requesting for file.ext, look for a smaller/newer file.ext.gz,
# and serve that instead if `Accept-Encoding: gzip` is in the
# request headers.
serve precompressed files = true
}
}