forked from nannal/avalon-nginx-config
-
Notifications
You must be signed in to change notification settings - Fork 6
/
default
64 lines (57 loc) · 2.13 KB
/
default
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
proxy_cache_path /var/cache/forever levels=1:2 keys_zone=forever:10m max_size=10g inactive=90d;
proxy_cache_path /var/cache/long levels=1:2 keys_zone=long:10m max_size=10g inactive=60m;
proxy_cache_path /var/cache/short levels=1:2 keys_zone=short:10m max_size=10g inactive=3m;
proxy_cache_path /var/cache/nearlive levels=1:2 keys_zone=nearlive:10m max_size=10g inactive=10s;
proxy_cache_key "$request_uri";
proxy_cache_methods GET HEAD;
server {
listen 80 default_server;
client_max_body_size 1G;
access_log /var/log/nginx/access.log;
server_name avalon.d.tube;
#Blocked
location ~*(/newkeypair){return 301 https://d.tube;}
#Forever
location ~*(/history/([a-z0-9-.]+)/[1-9]\d*)
{
proxy_cache_valid 90d;
proxy_cache forever;
expires 90d;
proxy_cache_min_uses 1;
add_header X-Cache-Status $upstream_cache_status;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_pass http://[::]:3001;
}
#Long
location ~*(/accountprice/|/config|/feed/([a-z0-9-.]+)/([a-z0-9-.]+))
{
proxy_cache_valid 1h;
proxy_cache long;
expires 1h;
proxy_cache_min_uses 1;
add_header X-Cache-Status $upstream_cache_status;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_pass http://[::]:3001;
}
#Short
location ~*(/allminers|/blog/|/distributed/|/feed|/followers|/follows|/hot|/notifications|/rewards/|/schedule|/supply|/transact|/trending|/trending/|/history|/oembed/|/opengraph/|/youtube/)
{
proxy_cache_valid any 1m;
proxy_cache short;
expires 1m;
proxy_cache_min_uses 1;
add_header X-Cache-Status $upstream_cache_status;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_pass http://[::]:3001;
}
#Near Live
location ~*(/block/|/account/|/accounts/|/content/|/count|/new|/rewardpool)
{
proxy_cache_valid any 3s;
proxy_cache nearlive;
expires 3s;
add_header X-Cache-Status $upstream_cache_status;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_pass http://[::]:3001;
}
}