How to set up cgit with Caddy

I am trying to set up cgit using Caddy.
This is an example of how I got it running with my nginx test machine:

server {
  listen 8081;
  server_name git.cgittest;
  root /usr/local/www/cgittest;
  index cgit.cgi;

  try_files $uri @cgit;

  location @cgit {
    index cgit.cgi;

    fastcgi_param PATH_INFO $uri;
    fastcgi_param SCRIPT_FILENAME $document_root/cgit.cgi;
    fastcgi_param CGIT_CONFIG $document_root/cgitrc;
    fastcgi_param HTTP_HOST $server_name;
    fastcgi_param QUERY_STRING $args;
    fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock;
    include fastcgi_params;
  }
}

I am not sure how I am supposed to approach this with Caddy, since there is a cgi plugin I would not have to use fcgiwrap? Would it better to use it anyway? In both cases I do not know how to set this up, given that I am new to the operation of web servers in general.

I am using Caddy 0.10.0, and my OS is FreeBSD 11.0.

I would be glad if someone could show me an example of how to get it running :slight_smile:, also happy for every other piece of information.

I am not sure how I am supposed to approach this with Caddy, since there is a cgi plugin I would not have to use fcgiwrap?

That’s correct. The CGI plugin appears to be the right way to use cgit. Once I get it working I will add an example in the cgi plugin documentation. That won’t be for a couple of days, however, since I will be away from my desk.

3 Likes

I just added an example on how to use cgit with Caddy. See the caddy-cgi repo for details.

cgit seems to be a really useful program – I’m glad to learn about it!

2 Likes

Thank you very much!
Yes cgit is indeed very useful and neat, I’m sure more people will benefit from this example.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.