From 1bd56dbd92d258473555de93efc3baf4c318d8f6 Mon Sep 17 00:00:00 2001 From: noe Date: Sat, 30 Mar 2024 13:34:42 -0400 Subject: [PATCH] ingress-proxy: add sapphic-engineer --- nixos/hosts/ingress-proxy/default.nix | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/nixos/hosts/ingress-proxy/default.nix b/nixos/hosts/ingress-proxy/default.nix index 4608af8..98c2e93 100644 --- a/nixos/hosts/ingress-proxy/default.nix +++ b/nixos/hosts/ingress-proxy/default.nix @@ -42,6 +42,13 @@ in { inactive = "720m"; }; + proxyCachePath."se" = { + enable = true; + keysZoneSize = "16m"; + keysZoneName = "se"; + inactive = "720m"; + }; + virtualHosts = let defaultConfig = { listen = [ @@ -106,6 +113,36 @@ in { ''; }; } // defaultConfig // { forceSSL = false; }; + + "sapphic.engineer" = { + locations."/" = { + recommendedProxySettings = true; + proxyPass = "https://se"; + proxyWebsockets = true; + extraConfig = '' + proxy_request_buffering off; + ''; + }; + + locations."/proxy" = { + recommendedProxySettings = true; + proxyPass = "https://se"; + + extraConfig = '' + proxy_request_buffering off; + proxy_cache se; + slice 1m; + proxy_cache_key $host$uri$is_args$args$slice_range; + proxy_set_header Range $slice_range; + proxy_buffering on; + proxy_cache_lock on; + proxy_ignore_client_abort on; + proxy_cache_valid 200 1y; + proxy_cache_valid 206 301 304 1h; + proxy_cache_use_stale error timeout invalid_header updating; + ''; + }; + } // defaultConfig // { forceSSL = false; }; }; };