为 Ominbus 安装程序的 GitLab 社区版启用 HTTPS 自签名证书

Enable HTTPS self signed cert for GitLab Community Edition for Ominbus installer

我有一个 Omnibus gitlab 安装程序。我正在尝试使用自签名证书设置 HTTPS url。我正在使用 Ubuntu 14.04 作为我的主机 OS。我接下来的步骤是:

已修改gitlab.rb

external_url 'https://gitlab.example.com'
nginx['redirect_http_to_https'] = true

创建具有正确名称的自签名证书并将其放置在 /etc/gitlab/ssl 下,权限为 600

-rw------- 1 root root 1289 Sep 5 08:38 gitlab.example.com.crt
-rw------- 1 root root 1679 Sep 5 08:38 gitlab.example.com.key

然后我做了gitlab-reconfigure并重启。

因此,当我尝试新的 URL 时:https://gitlab.example.com 页面无法加载。

端口 443 默认打开,我可以对其进行 netcap。

我正在关注此博客进行设置 - GitLab HTTPS with selfsigned

我在 /var/log/gitlab

下没有看到任何错误

自签名证书是否需要任何额外的 nginx 配置?

谁能告诉我应该查找哪些日志,我是否遗漏了任何步骤?

官方文档是“Settings NGiNXd

检查 issue 1374 是否与您的情况相关。

gitlab_rails['registry_key_path'] = "/etc/gitlab/ssl/gitlab.example.com.key"
registry['rootcertbundle'] = "/etc/gitlab/ssl/gitlab.example.com.crt"

You do not need to specify these two as per documentation on enabling Registry. These two are for internal communication and are auto generated.

如果 SSL/TLS 端口打开,最有可能的问题是与防火墙有关。检查您的防火墙设置,您可能需要 运行:

sudo ufw allow https

在最近的 Gitlab 14.9.2-ce 中,大多数 ssl 错误似乎已修复。

  • 这些设置当前适用于自签名 SSL:
# external URL must be https for nginx to also listen on port 443

external_url 'https://gitlab.iac'
letsencrypt['auto_renew'] = false
nginx['redirect_http_to_https'] = true
nginx['redirect_http_to_https_port'] = 80

在 运行 gitlab-ctl reconfigure 之后你可能还需要 gitlab-ctl restart 如果 nginx 没有监听端口 80 & 443(检查netstat -lptun)

如果问题仍然存在,很可能是防火墙问题,如此处所述。