improve caching

This commit is contained in:
Karol Wypchlo 2020-09-15 17:22:49 +02:00
parent c155fcfa55
commit c050948d23
1 changed files with 7 additions and 0 deletions

View File

@ -129,6 +129,10 @@ server {
location /hns {
include /etc/nginx/conf.d/include/cors;
include /etc/nginx/conf.d/include/proxy-buffer;
include /etc/nginx/conf.d/include/proxy-cache-downloads;
limit_conn downloads_by_ip 100; # ddos protection: max 100 downloads at a time
add_header Cache-Control "public, max-age=86400"; # allow consumer to cache response
set $skylink '';
set $skylink_path '';
@ -147,6 +151,9 @@ server {
end
}
proxy_read_timeout 600;
proxy_set_header User-Agent: Sia-Agent;
proxy_pass http://siad/skynet/skylink/$skylink$skylink_path;
header_filter_by_lua_block {