大网数据广告活动
服务器运维问答

Gitlab, Gitlab runner and reverse Proxy

· 52CE 我爱测

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 w…

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-12-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。