From bb6e4121f3d7fe945bffc45147243666efae0e09 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 13 Feb 2021 14:00:38 -0500 Subject: [PATCH] ao: cache static assets & turn off proxy buffering Also increase clientMaxBodySize, since I big files could be uploaded over HTTP. --- hosts/ao/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hosts/ao/default.nix b/hosts/ao/default.nix index e189df2e..2684dbad 100644 --- a/hosts/ao/default.nix +++ b/hosts/ao/default.nix @@ -37,10 +37,20 @@ with lib.my; default = true; forceSSL = true; enableACME = true; - locations."/".extraConfig = '' + locations."~* \.(?:ico|css|map|js|gif|jpe?g|png|ttf|woff)$".extraConfig = '' + access_log off; + expires 30d; + add_header Pragma public; + add_header Cache-Control "public, mustrevalidate, proxy-revalidate"; proxy_pass https://kiiro:8001; + proxy_buffering off; + ''; + locations."/".extraConfig = '' + client_max_body_size 10m proxy_ssl_server_name on; proxy_pass_header Authorization; + proxy_pass https://kiiro:8001; + proxy_buffering off; ''; };