From 52213d388daafff04afaa9c0a2194d299bdc8024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Wed, 26 Feb 2025 15:31:05 +0100 Subject: [PATCH] Fix nginx /cache regex `nix-serve` does not handle duplicates in the path: ``` hut$ curl http://127.0.0.1:5000/nix-cache-info StoreDir: /nix/store WantMassQuery: 1 Priority: 30 hut$ curl http://127.0.0.1:5000//nix-cache-info File not found. ``` This meant that the cache was not accessible via: `curl https://jungle.bsc.es/cache/nix-cache-info` but `curl https://jungle.bsc.es/cachenix-cache-info` worked. Reviewed-by: Rodrigo Arias Mallo --- m/hut/nginx.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m/hut/nginx.nix b/m/hut/nginx.nix index ef7c416..696ce01 100644 --- a/m/hut/nginx.nix +++ b/m/hut/nginx.nix @@ -40,7 +40,7 @@ in proxy_redirect http:// $scheme://; } location /cache { - rewrite ^/cache(.*) /$1 break; + rewrite ^/cache/(.*) /$1 break; proxy_pass http://127.0.0.1:5000; proxy_redirect http:// $scheme://; }