When you plan to run git-http-backend (which might be a part of Zuul's setup in your CI/CD) along side with Nginx and fastcgi, ensure to put there a proper config in the location, to avoid errors like:

- "Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or
  SCRIPT_FILENAME) set and is the script executable?"
- "fatal: GIT_PROJECT_ROOT is set but PATH_INFO is not"

Into your 'git-repos' location add the following fastcgi params:

DOCUMENT_ROOT /usr/lib/git-core;
GIT_PROJECT_ROOT /path_to_git_proj_root/git;
SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;

And ensure to have 'include' parameter, within location, as a last item.

So an example location for Zuul+git-http-backend+Nginx+fastcgi setup would look like below:

location ~ ^/p(/.*) {
    fastcgi_pass  unix:/run/fcgiwrap.socket;
    fastcgi_param DOCUMENT_ROOT       /usr/lib/git-core;
    fastcgi_param GIT_HTTP_EXPORT_ALL "";
    fastcgi_param GIT_PROJECT_ROOT    /var/lib/zuul/git/;
    fastcgi_param PATH_INFO           $1;
    fastcgi_param SCRIPT_FILENAME     /usr/lib/git-core/git-http-backend;
    include       /etc/nginx/fastcgi_params;


Current rating: 2


There are currently no comments

New Comment


required (not published)