如何在Gitlab中更改主机IP地址

时间:2018-04-18 08:07:30

标签: http iis header gitlab arr

我在运行Hyper-V的ubuntu服务器上安装了gitlab。当然,主机是路由Hyper-V来宾的Windows Server。我的Ubuntu服务器和Hyper-V NIC有私有IP地址," 10.0.0.101"和" 10.0.0.1"。为了路由到Hyper-V来宾,我设置了IIS ARR和URL重写,它运行良好。但是,在gitlab中,客户端的访问URL(例如git.example.com)用于指示"用户配置文件URL"比如this

我认为它不应该显示" http://10.0.0.101/test",但" http://git.example.com/test"我希望改变这一点。我更改了ARR设置  像HTTP Header和URL重写设置,如Server变量。然而,最终,它没有奏效。

我该如何改变?

1 个答案:

答案 0 :(得分:0)

您可以尝试编辑external_url 'https://gitlab.example.com' nginx['redirect_http_to_https'] = true (gitlab.rb)
如果我打开用户个人资料,我会得到正确的网址 我设置了这些设置:

https

但我在 nginx['ssl_client_certificate'] = "/etc/gitlab/ssl/ca.crt" nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.key" 下运行Gitlab,我不确定这是否有所改变。

bool checkTimeBSTorGMT = TimeZoneInfo.Local.IsDaylightSavingTime(records.GetDateTimeOrEmpty("notification_date"));
if (checkTimeBSTorGMT == true)
{
    DateTime dt = new DateTime();
    dt = records.GetDateTimeOrEmpty("notification_date");
    dt = dt.AddHours(1);
    instance.SentDateTime = dt;
}
else
{
    instance.SentDateTime = records.GetDateTimeOrEmpty("notification_date");
}