From 0c0a48748896f7c1dca7b017e38534bd723e4c60 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Sat, 7 Feb 2026 20:37:54 +0100 Subject: [PATCH] add cache to glance Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- server-modules/glance/default.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/server-modules/glance/default.nix b/server-modules/glance/default.nix index d6fcad6..8d75bbf 100644 --- a/server-modules/glance/default.nix +++ b/server-modules/glance/default.nix @@ -15,9 +15,26 @@ }; }; cloudflared.tunnels."f7c8f777-a36c-4b9a-b6e3-6a112bd43e73".ingress = { - "start.hadi.diy" = "http://localhost:${toString config.services.glance.settings.server.port}"; - "home.hadi.diy" = "http://localhost:${toString config.services.glance.settings.server.port}"; - "glance.hadi.diy" = "http://localhost:${toString config.services.glance.settings.server.port}"; + "start.hadi.diy" = "http://localhost:8755"; + "home.hadi.diy" = "http://localhost:8755"; + "glance.hadi.diy" = "http://localhost:8755"; + }; + + nginx.virtualHosts."glance.local" = { + listen = [ + { + addr = "127.0.0.1"; + port = 8755; + } + ]; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.services.glance.settings.server.port}"; + extraConfig = '' + proxy_cache_valid 200 30m; + proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; + add_header X-Cache-Status $upstream_cache_status; + ''; + }; }; };