summaryrefslogtreecommitdiff
path: root/roles/git-http-backend/templates/git-http-backend.conf
blob: 26e012bfc34ee98457c55cc8ef6dcb878e55068e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
location ~ /(.+)/(HEAD|info/refs|objects|git-upload-pack|git-receive-pack) {
  if (-f /srv/git/$1/{{ git_export_ok_file }}) {
    set $auth_basic   "private-write repository";
  }
  if (!-f /srv/git/$1/{{ git_export_ok_file }}) {
    set $auth_basic   "private repository";
  }
  if ($arg_service != git-receive-pack) {
    set $auth_basic   off;
  }
  auth_basic          $auth_basic;
  auth_basic_user_file .htpasswd;

  include             fastcgi_params;
  fastcgi_param       SCRIPT_FILENAME     /usr/libexec/git-core/git-http-backend;
  fastcgi_param       PATH_INFO           $uri;
  fastcgi_param       GIT_PROJECT_ROOT    /srv/git;
  fastcgi_param       GIT_HTTP_EXPORT_ALL 1;
  fastcgi_param       REMOTE_USER         $remote_user;
  fastcgi_param       HOME                /srv/git;
  fastcgi_pass        unix:{{ fcgiwrap_socket }};
}