问题原文
原帖链接 · alexandgu · CC BY-SA 4.0
I just installed Gitlab on an Ubuntu 18.04 fresh install. I am now trying to set up Gitlab runner (on the same machine, 192.168.1.8). I created a project and ran the test that comes predefined with the following error:
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:[email omitted]/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
Currently, Gitlab is behind a reverse proxy. So when a request arrives it goes as follows:
- 192.168.1.1 (router)
- 192.168.1.7 (proxy)
- 192.168.1.8 (gitlab)
I have noticed that from outside my network (192.168.1.0/24). I can access gitlab with no problem:
$ curl https://gitlab.aandraka.com
<html><body>You are being <a href="https://gitlab.aandraka.com/users/sign_in">redirected</a>.</body></html>
However if I try the same thing from inside the network (i.e. my gitlab machine).
curl https://gitlab.aandraka.com
curl: (51) SSL: certificate subject name '192.168.0.1' does not match target host name 'gitlab.aandraka.com'
As if instead of being redirected to the reverse proxy I am being redirected to the router config page.
Also my router came with the default network 192.168.0.0/24, so that's probably why the Certificate subject name is 192.168.0.1 instead of 192.168.1.1
已采纳解答
原帖链接 · alexandgu · CC BY-SA 4.0
So, turns out I found a way around it.
I just added my gitlab domain to /etc/hosts pointing to the reverse proxy.
Still, it would be interesting a proper way of accesing machines inside your network with a domain that points to the router.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
