-
Notifications
You must be signed in to change notification settings - Fork 1
/
srv.cfg
215 lines (194 loc) · 3.83 KB
/
srv.cfg
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
server basic_site {
listen = 8080
body_limit = 10
server_name = test test.org
error_dir = websites/basic_site/error_pages/
location /hello {
alias = websites/basic_site
methods = GET POST
dir_listing = true
default_file = index.html
upload_dir = some/dir/
}
location / {
alias = websites/basic_site/
methods = GET POST
dir_listing = true
upload_dir = some/dir/
}
location /secret {
alias = websites/basic_site/folder/special_page.html
methods = GET
default_file = index.html
}
location /broken {
alias = websites/basic_site/folder/special_page.html
methods = POST
}
location /redirection {
redir = https://www.google.com temporary
methods = GET
}
location /permanent-redirect{
redir = /hello permanent
}
location /forbidden {
methods = GET
}
location /php-no {
alias = websites/basic_site/php-no
methods = GET
dir_listing = true
default_file = index.php
}
location /php-yes {
alias = websites/basic_site/php-yes
methods = GET
cgi = .php $PHP_CGI
dir_listing = true
default_file = index.php
}
}
server demo_server {
listen = 4242
server_name = demo
location / {
alias = websites/demo/
methods = GET
default_file = index.html
}
}
server helloworld {
listen = 8080
server_name = helloworld
location / {
alias = websites/basic_site2/
methods = GET POST
default_file = default.html
}
}
server php-website {
listen = 127.0.0.1:7777
location / {
alias = websites/php_website/
methods = GET POST
cgi = .php $PHP_CGI
}
}
server pythong-test {
listen = 127.0.0.1:4200
listen = 4200
location / {
alias = websites/python-website/
methods = GET POST
cgi = .py /usr/bin/python3
dir_listing = true
default_file = index.py
}
location /jokes {
alias = websites/python-website/jokes
methods = GET
cgi = .py /usr/bin/python3
default_file = index.py
}
}
server bash {
listen = 127.0.0.1:1212
server_name = bash
location / {
alias = websites/bash-website/
methods = GET
cgi = .sh /bin/bash
default_file = index.sh
}
}
server site_with_uploads {
listen = 127.0.0.1:1338
location / {
alias = websites/site-with-uploads/
methods = GET POST
upload_dir = websites/site-with-uploads/uploads
default_file = index.html
}
location /uploads {
alias = websites/site-with-uploads/uploads
methods = GET
dir_listing = true
}
}
server site_with_delete {
listen = 0:1339
location / {
alias = ./websites/site-with-delete/
methods = GET
dir_listing = true
}
location /delete-allowed {
alias = ./websites/site-with-delete/delete-allowed
methods = GET DELETE
dir_listing = true
}
}
server cgi-testing {
listen = 1340
location / {
alias = ./websites/cgi-testing
methods = GET
default_file = index.html
}
location /folder1 {
alias = ./websites/cgi-testing/folder1
methods = GET
dir_listing = true
cgi = .alibaba $PHP_CGI
}
location /folder2 {
alias = ./websites/cgi-testing/folder2
methods = GET
dir_listing = true
cgi = .php $PHP_CGI
cgi = .alibaba $PHP_CGI
}
location /folder3 {
alias = ./websites/cgi-testing/folder3
methods = GET
dir_listing = true
cgi = .1337 $PHP_CGI
cgi = .42 /usr/bin/python3
}
location /folder4 {
alias = ./websites/cgi-testing/folder4
methods = GET
dir_listing = true
cgi = .broken /something/that/does/not/exist
}
location /folder5 {
alias = ./websites/cgi-testing/folder5
methods = GET
dir_listing = true
cgi = .php $PHP_CGI
}
}
server php-uploads {
listen = 1341
location / {
alias = ./websites/php-uploads
methods = GET POST
default_file = index.php
cgi = .php $PHP_CGI
}
location /uploads {
alias = ./websites/php-uploads/uploads
methods = GET POST
dir_listing = true
}
}
server fucked-cgi {
listen = 1342
location / {
alias = ./websites/fucked-cgi
methods = GET POST
default_file = index.wtf
cgi = .wtf /Users/skoulen/cursus42/webserv/a.out
}
}