1
0
angie-krdsh/site.avail/http-nodejs-org.krd.sh.conf

76 lines
1.6 KiB
Plaintext

proxy_cache_path
/var/cache/angie/proxy/nodejs-org
keys_zone=nodejs_org:10m
levels=1:2 inactive=1h;
server {
server_name nodejs-org.krd.sh;
include snip.d/listen-https;
include snip.d/ssl-krd.sh;
access_log off;
log_not_found off;
root /var/www/empty;
location /
{
try_files /.non-existent-uri @redirect;
}
location ~* \.(?:7z|exe|exp|gz|lib|msi|pkg|tgz|xz|zip)$
{
try_files /.non-existent-uri @redirect;
}
## merely quirk
location ~* ^/(?:dist|download)$
{
return 301 $scheme://$server_name$uri/;
}
location ~/$
~*^/(?:dist|download)/
{
try_files /.non-existent-uri @download;
}
proxy_set_header Accept "*/*";
proxy_set_header User-Agent "angie/$angie_version";
include snip.d/proxy-common-headers;
include snip.d/proxy-accept-encoding;
include snip.d/proxy-connection-close;
location @redirect
{
return 301 https://nodejs.org$request_uri;
}
location @download
{
proxy_pass https://nodejs.org$uri$is_args$args;
proxy_redirect https://nodejs.org $scheme://$server_name;
proxy_cache nodejs_org;
proxy_cache_key $uri;
expires 30m;
proxy_cache_valid 200 1h;
proxy_cache_valid 30s;
proxy_ignore_client_abort on;
proxy_ignore_headers Cache-Control Expires;
proxy_hide_header Cache-Control;
proxy_hide_header Expires;
## quirks
chunked_transfer_encoding off;
proxy_method GET;
proxy_temp_file_write_size 4m;
}
}