From ebaff5e74eaee861972b225117d55ba771aa5984 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 Jan 2015 16:17:28 +0100 Subject: Add cgit snippet. --- apache2/conf.available/cgit.conf | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 apache2/conf.available/cgit.conf diff --git a/apache2/conf.available/cgit.conf b/apache2/conf.available/cgit.conf new file mode 100644 index 0000000..5ccb726 --- /dev/null +++ b/apache2/conf.available/cgit.conf @@ -0,0 +1,31 @@ +AddDefaultCharset UTF-8 + + + Options None + AllowOverride None + Require all granted + + + + Options ExecCgi FollowSymLinks + AllowOverride None + Require all granted + + + + + Options None + AllowOverride None + Require all granted + + +RewriteEngine on + +RewriteRule ^/(cgit-css/)?(cgit\.(css|png)|favicon\.ico|robots.txt)$ /usr/share/cgit/$2 [last] + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule "^(.*)/(.*)/(HEAD|info/refs|objects/(info/[^/]+|[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\.(pack|idx))|git-(upload|receive)-pack)$" /usr/lib/git-core/git-http-backend/$1.git/$2 [NS,L,QSA] + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^(/.*)?$ /usr/lib/cgit/cgit.cgi$1 [T=application/x-httpd-cgi,L,NS] -- cgit v1.2.3