My previous server setup instructions had a problem. nginx and fcgiwrap have undesirable buffering which causes clones of large repos to time out.
To fix this first apply the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863478 to fcgiwrap and build/install it. Then modify the "location ~ ^.*\.git/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ {" block in your nginx conf. replace include fastcgi_params; with #note: NO_BUFFERING relies on a patched fcgiwrap. fastcgi_param NO_BUFFERING 1; include fastcgi_params; gzip off; fastcgi_buffering off; Restart nginx and fcgiwrap and you should be able to clone large repos. You might also want to increase the number of allowed cgi processes. The fcgiwrap default is to only allow one. The documentation for fcgiwrap says this can be done though /etc/default/fcgiwrap but that doesn't seem to work with systemd. Instead it seems you need to cp /lib/systemd/system/fcgiwrap.service /etc/systemd/system/fcgiwrap.service edit /etc/systemd/system/fcgiwrap.service and add -c <number> to the execstart parameter systemctl daemon-reload service fcgiwrap restart