服务器 debian 11
git version 2.30.2
nginx version 1.18.0
nginx 的配置如下:
server {
listen 80;
#省略部分
location ~ (/.*) {
client_max_body_size 0;
auth_basic "Git Login";
auth_basic_user_file "/var/www/html/myrepo/htpasswd";
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /var/www/html/myrepo;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $1;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
}
如果切换成其他端口则会提示
fatal: repository "http://XXXX:XX/XXX.git/" not found