-
Notifications
You must be signed in to change notification settings - Fork 5
/
example.nginx
73 lines (63 loc) · 1.69 KB
/
example.nginx
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
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 100000;
}
worker_rlimit_nofile 200000; # 2 * worker_connections
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
error_log /dev/null;
access_log /dev/null;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80 so_keepalive=10s:10s:8;
server_name onion.gq www.onion.gq;
location / {
default_type text/html;
root /var/www/onion2web/;
}
}
# For monitoring
# www.pastagdsp33j7aoq.onion.gq without confirmation
server {
listen 80;
server_name www.pastagdsp33j7aoq.onion.gq;
lua_check_client_abort on;
location / {
default_type text/html;
content_by_lua '
require("onion2web").handle_onion2web(
".onion.gq", nil, nil, false
);
';
}
}
server {
listen 80;
server_name *.onion.gq;
lua_check_client_abort on;
location / {
default_type text/html;
content_by_lua '
if not blocklist then
blocklist = {}
local f = io.open("/etc/blocklist.txt")
if f then
for host_md5 in f:lines() do
blocklist[host_md5] = true
end
f:close()
end
end
require("onion2web").handle_onion2web(".onion.gq",
nil, nil, true, blocklist);
';
}
}
}