Gitlab 启用https

Gitlab enable SSL how to
1.生成SSL所需要的证书
mkdir -p /etc/gitlab/ssl chmod 700 /etc/gitlab/ssl
openssl req -new -x509 -days 365 -nodes -out git.crt -keyout git.key

2.修改/etc/gitlab/gitlab.rb
external_url "https://git.opvps.com" nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/git.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/git.key"

external_url 这一行是修改定义域名

nginx['redirect_http_to_https'] = true 这一行设置nginx http自动跳https 下面的定义key

3.再执行gitlab-ctl reconfigure 即可

原文参考 gitlab