nginx之在GitLab中克隆的HTTP URL错误
mengfanrong
阅读:60
2024-02-27 23:08:18
评论:0
问题:
当我在GitLab中创建存储库时,由于某种原因,它会显示该存储库的不同HTTP URL和SSH URL。
例如)
HTTP: http://anotherexample.com/myrepo.git
SSH: git@gitlab.example.com/myrepo.git
My gitlab URL is: https: //gitlab.example.com, so SSH is correct and HTTP is wrong.
( anotherexample.com is the URL of my server before I set DNS.)
I looked at /var/opt/gitlab/gitlab-rails/etc/gitlab.yml, then found:
# 1. GitLab app settings
# ==========================
host: anotherexample.com
port: 80
https: false
ssh_host: gitlab.example.com
然后我手动更改了该主机,它暂时解决了。
但是,当我执行 gitlab-ctl重新配置时, gitlab.yml 将被更新。
问题:
如何在 /etc/gitlab/gitlab.rb 中为HTTP设置此主机名?
我已经有以下两行:
external_url 'https://gitlab.example.com'
gitlab_rails['gitlab_ssh_host'] = 'gitlab.example.com'
但似乎不适用于HTTP网址。
我的GitLab版本:8.8.3
我的服务器:CentOS 6.8 + Nginx 1.10.1
提前致谢。
请您参考如下方法:
解决了
我刚刚在 /etc/gitlab/gitlab.rb 中添加了以下行
gitlab_rails['gitlab_host'] = 'gitlab.example.com'
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。