Add git-http-backend example to Nginx post.
authorW. Trevor King <wking@drexel.edu>
Tue, 3 Apr 2012 18:19:56 +0000 (14:19 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 3 Apr 2012 18:19:56 +0000 (14:19 -0400)
posts/Nginx.mdwn

index 36615fa4497c882dd54e29d119b38f500f119916..df71fef2e86c0ac16fa9497f2618fd906ea61d3f 100644 (file)
@@ -98,6 +98,30 @@ Add it to the default runlevel with:
 
    # sudo rc-update add spawn-fcgi.fcgiwrap default
 
+If you also want a virtual host serving Git over HTTP, you can add a
+virtual host like:
+
+    server {
+      # http-git.example.com
+      listen 80;
+      server_name http-git.example.com;
+
+      access_log /var/log/nginx/http-git.example.com.access_log main;
+      error_log /var/log/nginx/http-git.example.com.error_log info;
+
+      location / {
+        include fastcgi_params;
+        fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
+        fastcgi_param GIT_HTTP_EXPORT_ALL "";
+        fastcgi_param GIT_PROJECT_ROOT /var/git;
+        fastcgi_param PATH_INFO $document_uri;
+        fastcgi_pass  unix:/var/run/fcgiwrap.sock-1;
+      }
+    }
+
+This uses the same FastCGI server we used for gitweb, but this time
+the backend CGI script is `git-http-backend`.
+
 Wildcard virtual hosts
 ======================