From 5d549df76729154433077b438a2d99d7dd85cbef 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. --- 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 4e77eb2..867982b 100644 --- a/m/hut/nginx.nix +++ b/m/hut/nginx.nix @@ -38,7 +38,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://; }