From: W. Trevor King Date: Tue, 3 Apr 2012 18:19:56 +0000 (-0400) Subject: Add git-http-backend example to Nginx post. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e252b7570a42c86f14cbdc144f49c5e83c31e4bb;p=blog.git Add git-http-backend example to Nginx post. --- diff --git a/posts/Nginx.mdwn b/posts/Nginx.mdwn index 36615fa..df71fef 100644 --- a/posts/Nginx.mdwn +++ b/posts/Nginx.mdwn @@ -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 ======================