修改gitlab访问地址
vi /etc/gitlab/gitlab.rb修改如下
external_url 'http://59.110.159.79:8085/gitlab' //需要添加ip+端口或者(域名+端口+访问前缀)
修改了配置一定要重置配置!!!
给gitlab配置相对路径
Configure a relative URL for GitLab
For self-compiled (source) installations, there is a separate document.
While we recommended installing GitLab in its own (sub)domain, sometimes it is not possible. In that case, GitLab can also be installed under a relative URL, for example, https://example.com/gitlab.
By changing the URL, all remote URLs change as well, so you must manually edit them in any local repository that points to your GitLab instance.
To enable relative URL in GitLab:
- Set the external_url in /etc/gitlab/gitlab.rb:In this example, the relative URL under which GitLab is served is /gitlab. Change it to your liking.
- Reconfigure GitLab:
external_url "https://example.com/gitlab"
sudo gitlab-ctl reconfigure
If you have any issues, see the troubleshooting section.
重置配置
sudo gitlab-ctl reconfigure
重启gitlab服务
sudo gitlab-ctl restart
文章评论