-
Notifications
You must be signed in to change notification settings - Fork 2
/
default.conf
129 lines (104 loc) · 4.09 KB
/
default.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Guide to .conf files:
# block identifiers:
# server servers are sockets that listen to one or multiple ip:port
# combinations. They can also be referenced by unique name(s).
# They operate in the directory specified as root and can
# process all request types, but no CGI or directory listing
# location locations serve as proxies inside the server to enable some
# additional features such as redirection, CGI and
# directory listing
# server identifiers:
# ip-address The ip of the server inside the cluster.
# It must be specified once per server block
# port The port(s) the server listens to.
# At least one port must be specified per server block
# -> note: There must never be a duplicate ip-address:port combination
# server_name An alias for the default (first) ip:port combination of
# the server in order to make accessing servers more intuitive.
# Not required and multiple names are possible, but each of them
# must be unique across all server blocks
# root The directory the server operates in (including subdirectories).
# Must be specified once per server block
# index The default file the server answers with if the request is
# the root directory (defaults to index.html)
# Can be specified once
# allowed_methods The HTTP methods allowed inside the server block.
# Can be specified multiple times.
# Available options are: GET, POST, DELETE and PUT
# -> note: Locations may define their own allowed_methods
# redirection Key-value-pairs of files or directories that resembles the
# redirection of the key to the value.
# Can be specified multiple times.
# max_client_body_size The maximum body size of the response.
# Can be specified once (defaults to UINT32_MAX)
# errorpages A directory to look for [statuscode].html files.
# Can be specified once. If none are provided a default path is used
# location See description below.
# Can be specified multiple times.
# location identifiers:
# prefix The string right after the location identifier.
# It specifies the directory the location block looks for in the
# request URI.
# Must (obviously) be specified once
# root The actual directory of the location inside the server
# Any matching prefixes will be redirected to the root directory
# Can be specified once (defaults to the prefix directory)
# index The file that will be sent if the request is the root directory
# of this location.
# Must be specified once (unlike the server it doesn't have a default)
# allowed_methods Same as in the server block.
# redirection Same as in the server block.
# max_client_body_size Same as in the server block.
# allowed_scripts Key-value-pairs of a script extension (e.g. py for python)
# and the path to the executable. Separated by a = sign.
# The executable name must be a binary with execution permissions.
# Can be specified multiple times
# directory_listing Enables / Disables directory listing in the location block.
# Can be specified once (defaults to false)
server
{
server_name lilServ
ip-address 127.0.0.1
port 8080
port 8081
root testServerDir/
allowed_methods GET
index index.html
# max_client_body_size 10000
errorpages config/default_error_pages
redirection test = hello
# location /
# {
# root /
# allowed_methods GET POST DELETE
# allowed_scripts python = /usr/bin/python
# allowed_scripts php = /usr/bin/php
# index index.html
# directory_listing false
# }
location /test/
{
allowed_methods GET POST
allowed_scripts py = /usr/bin/python
allowed_scripts php = /usr/bin/php
index Form.html
directory_listing true
redirection hello = world
redirection world = tobi
redirection tobi = uploads
}
location /test/uploads/
{
root /test/uploads/
allowed_methods GET PUT DELETE POST
directory_listing true
index lol.html
}
location /cookie_test/
{
root /cookie_test/
allowed_methods GET
index cookie_index.py
allowed_scripts py = /usr/bin/python
}
}