From a97382c5028b054a7ffc76f1b59c7f103898d6d7 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 3 Aug 2026 16:49:18 +0100 Subject: cgit: Move try_files to location context. --- guix/forge/cgit.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/guix/forge/cgit.scm b/guix/forge/cgit.scm index bfdcf9c..2f6598f 100644 --- a/guix/forge/cgit.scm +++ b/guix/forge/cgit.scm @@ -256,7 +256,6 @@ configured in @var{config}." (server-name (list server-name)) ;; cgit static files (root (file-append cgit "/share/cgit")) - (try-files (list "$uri" "@cgit")) (locations (list ;; git-http-backend for the smart HTTP protocol @@ -287,7 +286,13 @@ configured in @var{config}." "fastcgi_param HTTP_HOST $server_name;" (string-append "fastcgi_pass " (nginx-socket->string socket) - ";"))))))))) + ";")))) + ;; On other URIs, try a file before falling back to @cgit. This try_files + ;; cannot be in the server context because it would then apply to + ;; git-http-backend, etc. + (nginx-location-configuration + (uri "/") + (body (list "try_files $uri @cgit;")))))))) (define cgit-service-type (service-type -- cgit 1.4.1