-
Notifications
You must be signed in to change notification settings - Fork 5
/
nginx.conf
54 lines (39 loc) · 1003 Bytes
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Generated and Modified at [https://winginx.com/en/htaccess - Alexei Shabalin]
# map "$request_uri:$host" $test {
# default 0;
# "/:jollofframework.com" 1;
# }
location ~ /documentation/ {
expires 30s;
}
# Prevent Hot-linking (especially for images)
location / {
if ($http_referer !~ "^$"){
set $hotlink noref;
}
if($request_uri ~* "\.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$"){
set $hotlink "${hotlink}found";
}
if($hotlink = noreffound){
return 403;
}
if ($http_user_agent ~* "^Teleport\ Pro"){
set $xagent ex;
}
if($http_user_agent ~* "^HT\ ?Track"){
set $xagent "${xagent}ce";
}
if($http_user_agent ~* "^BackWeb"){
set $xagent "${xagent}pt";
}
if($http_user_agent ~* "^BatchFTP"){
set $xagent "${xagent}io";
}
if($http_user_agent ~* "^BecomeBot"){
set $xagent "${xagent}n";
}
if($xagent = exception){
rewrite ^(.*)$ /web.abused break;
}
rewrite !^(.+\.)([a-z]+)(/)?$ /public/index.php last;
}