For the server-side to properly respond to v2 protocol requests, the webserver must set the GIT_PROTOCOL environment variable to the value of the Git-Protocol: request header. Link: https://lore.kernel.org/git/YTNtVJy6sCfQ7T3L@xxxxxxxxxxxxxxxxxxxxxxx/ Reported-by: Philippe Blain <levraiphilippeblain@xxxxxxxxx> Signed-off-by: Konstantin Ryabitsev <konstantin@xxxxxxxxxxxxxxxxxxx> --- Documentation/technical/protocol-v2.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/technical/protocol-v2.txt b/Documentation/technical/protocol-v2.txt index 1040d85319..7a0e97cc8d 100644 --- a/Documentation/technical/protocol-v2.txt +++ b/Documentation/technical/protocol-v2.txt @@ -81,6 +81,21 @@ A v2 server would reply: Subsequent requests are then made directly to the service `$GIT_URL/git-upload-pack`. (This works the same for git-receive-pack). +The web server handling the requests must properly set the GIT_PROTOCOL +environment variable when it finds `Git-Protocol` in the request headers. + +Apache example: + + SetEnvIf Git-Protocol ".*" GIT_PROTOCOL=$0 + +Nginx + uwsgi example: + + uwsgi_param GIT_PROTOCOL $http_git_protocol; + +Nginx + fastcgi example: + + fastcgi_param GIT_PROTOCOL $http_git_protocol; + Capability Advertisement ------------------------ base-commit: e0a2f5cbc585657e757385ad918f167f519cfb96 -- 2.31.1