我刚刚在Ubuntu18.04新安装上安装了Gitlab。我现在正在尝试设置Gitlab runner (在同一台机器上,192.168.1.8)。我创建了一个项目,并运行了带有以下错误的预定义的测试:
Running with gitlab-runner 10.5.0 (10.5.0)
on gitlab xxxxx
Using Shell executor...
Running on gitlab...
Cloning repository...
Cloning into '/var/lib/gitlab-runner/builds/xxxxxx/0/alexandgu/exporttool'...
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.aandraka.com/alexandgu/exporttool.git/': SSL: certificate subject name (192.168.0.1) does not match target host name 'gitlab.aandraka.com'
ERROR: Job failed: exit status 1目前,Gitlab支持反向代理。因此,当请求到达时,如下所示:- 192.168.1.1 (路由器)- 192.168.1.7 (代理)- 192.168.1.8 (gitlab)
我已经从我的网络之外(192.168.1.0/24)注意到了这一点。我可以毫无问题地进入gitlab:
$ curl https://gitlab.aandraka.com
<html><body>You are being <a href="https://gitlab.aandraka.com/users/sign_in">redirected</a>.</body></html>但是,如果我从网络内部尝试同样的事情(即我的gitlab机器)。
curl https://gitlab.aandraka.com
curl: (51) SSL: certificate subject name '192.168.0.1' does not match target host name 'gitlab.aandraka.com'好像我不是被重定向到反向代理,而是被重定向到路由器配置页面。
另外,我的路由器附带了默认的网络192.168.0.0/24,所以这可能就是为什么证书主题名是192.168.0.1而不是192.168.1.1的原因
发布于 2019-12-14 11:22:43
结果我找到了绕过它的方法。
我刚刚将我的gitlab域添加到指向反向代理的/etc/hosts中。
不过,这将是一个有趣的适当方式,以访问您的网络内的域名,指向路由器。
发布于 2019-12-14 11:36:44
看起来,您似乎忘记将本地DNS服务器配置为指向反向代理。把它修好,剩下的就会跟进了。
https://serverfault.com/questions/995552
复制相似问题