更改默认 Gitlab 端口 [英] Changing the default Gitlab port

查看:18
本文介绍了更改默认 Gitlab 端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过 Omnibus 软件包在 CentOS 7(全新安装)上安装了最新的 Gitlab-CE (8.10),如下所述:https://about.gitlab.com/downloads/#centos7

I have installed the latest Gitlab-CE (8.10) on CentOS 7 (fresh install) via the Omnibus package as described here: https://about.gitlab.com/downloads/#centos7

现在,我想更改可以访问 Gitlab Web 界面的默认端口.为此,我按照 http://docs.gitlab.com/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 http://docs.gitlab.com/omnibus/settings/nginx.html#change-the-default-port-and-the-ssl-certificate-locations, namely I included

external_url "http://127.0.0.1:8765"

在配置文件/etc/gitlab/gitlab.rb中然后用gitlab-ctl reconfigure &&更新配置gitlab-ctl 重启.

但是,当我导航到 http://127.0.0.1:8765 时,Gitlab 会一直重定向到 http://127.0.0.1/users/sign_in,即,端口规范以某种方式被丢弃.然后,当我手动将浏览器中的 URL 更改为 http://127.0.0.1:8765/users/sign_in 时,它会正确显示登录页面,有趣的是,页面上的所有链接(例如,"Explore", "Help") 包含端口规范.

However, when I then navigate to http://127.0.0.1:8765, Gitlab keeps redirecting to http://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 http://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?

推荐答案

问题在这里:https://gitlab.com/gitlab-org/gitlab-ce/issues/20131解决方法:将此行添加到/etc/gitlab/gitlab.rb:

Issue here: https://gitlab.com/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

它在 Debian 8.5 上对我有帮助,来自 gitlab repo 的 gitlab-ce.

It helps me on Debian 8.5, gitlab-ce from gitlab repo.

这篇关于更改默认 Gitlab 端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆