我已通过Omnibus软件包在CentOS 7(全新安装)上安装了最新的Gitlab-CE(8.10),如下所述: about.gitlab/downloads/#centos7
I have installed the latest Gitlab-CE (8.10) on CentOS 7 (fresh install) via the Omnibus package as described here: about.gitlab/downloads/#centos7
现在,我想更改可以访问Gitlab Web界面的默认端口.为此,我遵循了 docs.gitlab/omnibus/settings/nginx.html#change-the-default-port-and-the-ssl-certificate-locations ,即我包括了
Now, I would like to change the default port at which one can access the Gitlab web interface. To this end, I followed the instructions at docs.gitlab/omnibus/settings/nginx.html#change-the-default-port-and-the-ssl-certificate-locations, namely I included
external_url "127.0.0.1:8765"配置文件/etc/gitlab/gitlab.rb中的
,然后用gitlab-ctl reconfigure && gitlab-ctl restart更新配置.
in the configuration file /etc/gitlab/gitlab.rb and then updated the configuration with gitlab-ctl reconfigure && gitlab-ctl restart.
但是,当我随后导航到127.0.0.1:8765时,Gitlab会继续重定向到127.0.0.1/users/sign_in,即,以某种方式丢弃了端口规范.然后,当我在浏览器中手动将URL更改为127.0.0.1:8765/users/sign_in时,它会正确显示登录页面,有趣的是,页面上的所有链接(例如"Explore","Help")都包含端口规范.
However, when I then navigate to 127.0.0.1:8765, Gitlab keeps redirecting to 127.0.0.1/users/sign_in, i.e., the port specification is somehow discarded. When I then manually change the URL in the browser to 127.0.0.1:8765/users/sign_in, it correctly displays the login page and interestingly, all links on the page (e.g., "Explore", "Help") contain the port specification.
为了解决此问题,是否有必要在/etc/gitlab/gitlab.rb之外的其他地方指定端口?
In order to fix this behavior, is it necessary to specify the port also somewhere else than in /etc/gitlab/gitlab.rb?
推荐答案问题在这里: gitlab/gitlab-org/gitlab-ce/issues/20131 解决方法: 将此行添加到/etc/gitlab/gitlab.rb:
Issue here: gitlab/gitlab-org/gitlab-ce/issues/20131 Workaround: add this line to /etc/gitlab/gitlab.rb:
nginx['proxy_set_headers'] = { "X-Forward-Port" => "8080", "Host" => "<hostname>:8080" }用您的值替换端口和主机名,然后以root或sudo替换:
replace port and hostname with your values, then as root or with sudo:
gitlab-ctl reconfigure gitlab-ctl restart它对我在gitlab repo上的gitlab-ce上的Debian 8.5上有帮助.
It helps me on Debian 8.5, gitlab-ce from gitlab repo.
更多推荐
更改默认的Gitlab端口
发布评论