From c432e26e693fe1f445c8bffdb69e23da36d856fa Mon Sep 17 00:00:00 2001 From: RGBCube Date: Mon, 5 Feb 2024 13:18:17 +0300 Subject: [PATCH] Fix chat and sync 3rdl domains --- hosts/cube/matrix-synapse.nix | 16 ++++++++++++++++ hosts/cube/site.nix | 12 ++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/hosts/cube/matrix-synapse.nix b/hosts/cube/matrix-synapse.nix index 88fc666..2612038 100644 --- a/hosts/cube/matrix-synapse.nix +++ b/hosts/cube/matrix-synapse.nix @@ -97,6 +97,14 @@ in serverSystemConfiguration { locations."/_matrix".proxyPass = "http://[::]:${toString synapsePort}"; locations."/_synapse/client".proxyPass = "http://[::]:${toString synapsePort}"; + + locations."/".proxyPass = "http://[::]:${toString config.services.site.port}/404/"; + locations."/assets" = { + proxyPass = "http://[::]:${toString config.services.site.port}/assets"; + extraConfig = '' + add_header Cache-Control "public, max-age=10800, immutable"; + ''; + }; }; services.matrix-sliding-sync = enabled { @@ -114,5 +122,13 @@ in serverSystemConfiguration { locations."~ ^(\\/_matrix|\\/_synapse\\/client)" .proxyPass = "http://[::]:${toString syncPort}"; + + locations."/".proxyPass = "http://[::]:${toString config.services.site.port}/404/"; + locations."/assets" = { + proxyPass = "http://[::]:${toString config.services.site.port}/assets"; + extraConfig = '' + add_header Cache-Control "public, max-age=10800, immutable"; + ''; + }; }; } diff --git a/hosts/cube/site.nix b/hosts/cube/site.nix index ffa6afc..5ef6498 100644 --- a/hosts/cube/site.nix +++ b/hosts/cube/site.nix @@ -4,10 +4,6 @@ let inherit (config.networking) domain; port = 8003; - - cacheConfig = '' - add_header Cache-Control "public, max-age=10800, immutable"; - ''; in serverSystemConfiguration { services.site = enabled { inherit port; @@ -17,7 +13,9 @@ in serverSystemConfiguration { locations."/".proxyPass = "http://[::]:${toString port}"; locations."/assets" = { proxyPass = "http://[::]:${toString port}/assets"; - extraConfig = cacheConfig; + extraConfig = '' + add_header Cache-Control "public, max-age=10800, immutable"; + ''; }; }; @@ -31,7 +29,9 @@ in serverSystemConfiguration { locations."/".proxyPass = "http://[::]:${toString port}/404/"; locations."/assets" = { proxyPass = "http://[::]:${toString port}/assets"; - extraConfig = cacheConfig; + extraConfig = '' + add_header Cache-Control "public, max-age=10800, immutable"; + ''; }; }; }