Skip to content

Instantly share code, notes, and snippets.

@cacharle
Created September 6, 2023 19:53
Show Gist options
  • Save cacharle/e4e6d93710c45ee6a33a1f31d1b91b4c to your computer and use it in GitHub Desktop.
Save cacharle/e4e6d93710c45ee6a33a1f31d1b91b4c to your computer and use it in GitHub Desktop.
cgit configuration files
server {
listen 80 default_server;
listen [::]:80 default_server;
root /usr/share/cgit;
try_files $uri @cgit;
location ~ /.+/(info/refs|git-upload-pack) {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
fastcgi_param PATH_INFO $uri;
fastcgi_param GIT_HTTP_EXPORT_ALL 1;
fastcgi_param GIT_PROJECT_ROOT /var/git;
fastcgi_param HOME /var/git;
fastcgi_pass unix:/run/fcgiwrap.socket;
}
location @cgit {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
fastcgi_param PATH_INFO $uri;
fastcgi_param QUERY_STRING $args;
fastcgi_param HTTP_HOST $server_name;
fastcgi_pass unix:/run/fcgiwrap.socket;
}
}
css=/cgit.css
logo=/cgit.png
virtual-root=/
clone-prefix=http://foo.com
root-title=Charles' git server
root-desc=A web interface to my git repositories, powered by Cgit
readme=master:README.md
# HAS to be last
scan-path=/var/git/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment