-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
38 lines (37 loc) · 1.35 KB
/
nginx.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
server {
listen 80;
server_name _;
root /home/ubuntu/attacker/attackWeb;
index index.html;
add_header Access-Control-Allow-Origin *;
location /attack {
proxy_pass http://a2f5eee7f554240f0aa323d80f730bc0-2112827677.eu-west-1.elb.amazonaws.com/api/;
}
location ~* ^/attack/(.*) {
proxy_pass http://$1;
}
location /restart {
content_by_lua_block {
local res = os.execute('echo "1" > /home/ubuntu/attacker/attackWeb/restart-server.txt')
local time = os.date("%m/%d/%Y %I:%M:%S %p")
if res == 0 then
ngx.header["Content-type"] = "text/plain"
ngx.say('Restarted '.. time)
else
ngx.status = ngx.HTTP_NOT_FOUND
ngx.header["Content-type"] = "text/plain"
ngx.say('The world is doomed '.. time)
ngx.say('because of ' .. res)
end
}
}
location ^~ /nohup.txt {
add_header Content-Type text/plain;
}
location ^~ /output.txt {
add_header Content-Type text/plain;
}
location / {
try_files $uri $1 $uri/ /index.html =404;
}
}