更改默认的Gitlab端口

编程入门 行业动态 更新时间:2024-10-26 07:35:25
本文介绍了更改默认的Gitlab端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已通过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端口

本文发布于:2023-08-07 03:40:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1316766.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:端口   Gitlab

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!