[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set up cgit with git-http-backend properly

From: Simon Streit
Subject: Re: Set up cgit with git-http-backend properly
Date: Mon, 04 Jul 2022 12:29:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hello Florian,

"pelzflorian (Florian Pelz)" <> writes:

> what did you base your setup on?

I've been trying to figure it out from the manual and could have found a
config snippet months ago while setting it up.  It has not worked as
expected since.

> with uri-path "/git".  I think you want "/" though because you have
> its own domain.  Or maybe you want "".

To keep things simple I'm only trying to get it working with
‘git-http-nginx-location-configuration’ now.  So far it appears that it
only works when ‘uri-path’ is anything else than "" or "/".

Looking at the service definition in ‘gnu/services/version-contro.scm’
"" and "/" are the same the output of nginx' config file.  After

(string-append "~ /" (string-trim-both uri-path #\/) "(/.*)")


(string-append "~ " (string-trim-both uri-path #\/) "(/.*)")

serving and cloning from works now.
But it doesn't when cgit is enabled and serving repositories in the same
path at the same time.

Good news is that I'm at a step further now and have it working with:

 (server-name '(""))
 (root cgit)
 (try-files (list "$uri" "@cgit"))
    (uri "@cgit")
    (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;"
            "fastcgi_param PATH_INFO $uri;"
            "fastcgi_param QUERY_STRING $args;"
            "fastcgi_param HTTP_HOST $server_name;"
   (nginx-location-configuration (uri "/.well-known")
                                 (body '("root /var/www;")))))
 (ssl-certificate "/etc/letsencrypt/live/")
 (ssl-certificate-key "/etc/letsencrypt/live/"))

Though I still rather not keep the URL at
‘’ for cloning.

Is there maybe another way around this?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]