How to serve GIT through HTTP via NGINX with user/password?

前端 未结 3 979
余生分开走
余生分开走 2020-12-02 13:44

Despite all the links I\'ve found on how to configure git/nginx to get my repos, I can\'t make them work.

I followed this tutorial, Git repository over HTTP WebDAV w

3条回答
  •  离开以前
    2020-12-02 14:30

    Adding more details, we need 3 components: nginx, git-http-backend and fcgiwrap.

    • git-http-backend is a standalone excutable binary can be built from https://github.com/git/git . It's the official solution for handling git http/https access, I don't know if it is the best one that exists.
    • Nginx do not have a built-in general FastCGI server(or I failed to find how to use nginx's fastcgi_bind correctly). So another fastcgi server should be used, like fcgiwarp( a good manual https://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/ )
    • Use fastcgi_pass unix:/tmp/cgi.sock; in nginx config (reference to other answers)

    ==update==

    fastcgi is not a must, and git-http-backend is not write only for fastcgi, and fastcgi is not simplest nor performance one. for examples, I wrote a servlet to interact between nginx and git-http-backend, using nginx's proxy_pass, it also works!

提交回复
热议问题