GitWeb via Nginx
220 words ยท 2 minutes
Overview
GitWeb is a simple web-based visualizer for git repositories. By default, GitWeb will only run with the lighttpd
or webrick
web servers.
However, this guide will show you how to keep GitWeb running in the background and display information for all repositories in a chosen directory.
See below for the final result:
Install Dependencies
To start, you'll need install the following packages:
Configure Nginx
Once installed, create an Nginx configuration file.
server {
80;
example.com;
location /index.cgi {
/usr/share/gitweb/;
include fastcgi_params;
off;
SCRIPT_NAME $uri;
GITWEB_CONFIG /etc/gitweb.conf;
unix:/var/run/fcgiwrap.socket;
}
location / {
/usr/share/gitweb/;
index index.cgi;
}
}
To make the configuration active, you need to symlink it and then restart Nginx.
The GitWeb application should now be available via the URL you set in the Nginx configuration above.
Customize GitWeb
If you need to, you can customize many things about Gitweb by editing the gitweb.conf file.