gitlab 设置外部项目地址

编辑配置文件

# Omnibus 安装
sudo nano /etc/gitlab/gitlab.rb

# 源码安装
sudo nano /home/git/gitlab/config/gitlab.yml
设置 HTTPS 基础 URL
确保以下配置存在且正确:
# Omnibus 配置示例
external_url 'https://gitlab.yourcompany.com'  # 必须是 https:// 开头
nginx['redirect_http_to_https'] = true        # 强制 HTTP 跳转到 HTTPS
# 修改 gitlab.yml
sudo nano /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
production: &base
  gitlab:
    host: "gitlab.yourdomain.com"  # 域名与 external_url 一致
    port: 443                      # HTTPS 端口
    https: true                    # 明确启用 HTTPS

重新配置/重启 GitLab

## 生效重启
# Omnibus 安装
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

# 源码安装
sudo service gitlab restart