diff --git a/hosts/cube/site.nix b/hosts/cube/site.nix index 18a2659..ffa6afc 100644 --- a/hosts/cube/site.nix +++ b/hosts/cube/site.nix @@ -4,13 +4,21 @@ let inherit (config.networking) domain; port = 8003; + + cacheConfig = '' + add_header Cache-Control "public, max-age=10800, immutable"; + ''; in serverSystemConfiguration { services.site = enabled { inherit port; }; services.nginx.virtualHosts.${domain} = (sslTemplate domain) // { - locations."/".proxyPass = "http://[::]:${toString port}"; + locations."/".proxyPass = "http://[::]:${toString port}"; + locations."/assets" = { + proxyPass = "http://[::]:${toString port}/assets"; + extraConfig = cacheConfig; + }; }; services.nginx.virtualHosts."www.${domain}" = (sslTemplate domain) // { @@ -20,7 +28,10 @@ in serverSystemConfiguration { }; services.nginx.virtualHosts._ = (sslTemplate domain) // { - locations."/".proxyPass = "http://[::]:${toString port}/404/"; - locations."/assets".proxyPass = "http://[::]:${toString port}/assets"; + locations."/".proxyPass = "http://[::]:${toString port}/404/"; + locations."/assets" = { + proxyPass = "http://[::]:${toString port}/assets"; + extraConfig = cacheConfig; + }; }; }