2
我在我的大學的本地計算機上安裝了Gitlab 5.2 + Nginx。通過http克隆適用於內部網絡中的機器,但嘗試從外部網絡上的計算機進行克隆會導致「致命:身份驗證失敗」消息,即使提供了完全相同的憑據。 (我使用與通過Web界面登錄Gitlab相同的憑證)通過http進行的Gitlab克隆無法通過外部網絡進行身份驗證
可從外部網絡訪問Gitlab Web界面。只有通過http失敗的克隆(克隆通過ssh是不可能的,因爲端口22被阻塞)
下面是從相關的配置文件的一些線路:
從配置/ gitlab.ymlhost: mydomain
port: 80
https: false
下面是從ngnix配置文件
server {
listen *:80 default_server; # In most cases *:80 is a good idea
server_name mydomain; # e.g., server_name source.example.com;
root /home/git/gitlab/public;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
location/{
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @gitlab;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
proxy_read_timeout 2000; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_connect_timeout 2000; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://gitlab;
}
}
注意相關線路:我加入這行到/ etc/hosts文件:127.0.0.1 mydomain
但它確實沒有真正的幫助。 (基於https://github.com/gitlabhq/gitlabhq/issues/3483#issuecomment-15783597)
任何想法可能是/我該如何調試?
只是爲了澄清 - 我不使用LDAP身份驗證。奇怪的是,git over http實際上是從內部網絡運行的。當我嘗試從外部網絡執行它時,它只會失敗。 – Anirudh