【问题标题】:How can i change host IP address in Gitlab如何在 Gitlab 中更改主机 IP 地址
【发布时间】:2018-09-28 09:11:24
【问题描述】:

我在运行 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 重写设置。然而,最终没有奏效。

我该如何改变这个?

【问题讨论】:

    标签: http iis header gitlab arr


    【解决方案1】:

    您可以尝试编辑您的GITLAB_CONFIG (gitlab.rb)
    如果我打开用户个人资料,我会得到正确的网址。
    我已经设置了这些设置:

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

    但我在 https 下运行 Gitlab,我不确定这是否会改变什么。

     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"
    

    【讨论】:

    • 感谢您的回答。我设置了“external_url”,但没有成功。 SSL 连接没有问题,因为它是由主机的 IIS 建立的。我想设置 HTTP Header 来修改访客的 nginx 识别为的访问信息。
    猜你喜欢
    • 2017-12-19
    • 2018-02-10
    • 1970-01-01
    • 2020-01-11
    • 2012-02-10
    • 1970-01-01
    • 1970-01-01
    • 2016-11-28
    • 1970-01-01
    相关资源
    最近更新 更多