From e252b7570a42c86f14cbdc144f49c5e83c31e4bb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 3 Apr 2012 14:19:56 -0400 Subject: [PATCH] Add git-http-backend example to Nginx post. --- posts/Nginx.mdwn | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 ====================== -- 2.26.2