对nginx可见的git用户名

对nginx可见的git用户名,git,nginx,Git,Nginx,我让gitlab服务器在nginx后面运行。每当客户端执行任何git命令(git clone、git pull、git commit等)时,都需要执行一些自定义身份验证 nginx如何读取git用户名?如果没有设置用户名/电子邮件,git将使用默认值,即默认机器名和登录用户 $ $ git init tmp Initialized empty Git repository in /root/tmp/.git/ $ cd tmp $ git commit -m"Message" --allow-e

我让gitlab服务器在nginx后面运行。每当客户端执行任何git命令(git clone、git pull、git commit等)时,都需要执行一些自定义身份验证


nginx如何读取git用户名?

如果没有设置用户名/电子邮件,git将使用默认值,即默认机器名和登录用户

$
$ git init tmp
Initialized empty Git repository in /root/tmp/.git/
$ cd tmp
$ git commit -m"Message" --allow-empty

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@....(none)')
NGiNX的意思是

如果是这样,GitLab本身将通过NGiNX请求您的用户名/密码(除非您有一个
git config credential.helper
,它将缓存这些凭据)


这与
user.name
/
user.email
(仅用于提交作者身份)无关。

git是否使用http传输?你指的是什么样的自定义身份验证?我不确定http传输协议。我有一个配置为public的git项目。但是,一些用户不应该访问该项目。我不寻找用户名/密码身份验证。我想使用用户名和git url创建一些自定义验证/权限方案。为此,我需要读取username和git URL的值。git URL我可以访问,但不确定如何访问用户名。@SVGKRaju没有专用用户名(使用HTTPS时):您可以通过
git ls remote HTTPS://:@yourServer//
进行测试/验证。但是您需要知道您想要验证的用户访问权限我知道git配置。我的问题是nginx如何知道谁在试图访问git回购。