Gerrit更改Canonical URL

时间:2015-03-12 18:37:01

标签: .htaccess gerrit

我已经在gerrit.mydomain.com的子域上设置了gerrit。默认情况下,gerrit在端口8080上运行,所以我将gerrit.config [httpd]部分的端口更改为80,所以现在gerrit.mydomain.com打开gerrit主页。

现在,当我通过运行以下命令打印规范网址时:

git config -f ~/gerrit_folder/etc/gerrit.config gerrit.canonicalWebUrl

它仍然显示如下网址:

http://localhost:8080/

现在问题是当我通过openID登录时,它返回我的域名为gerrit.mydomain.com:8080并且没有任何反应,因为那里没有服务器

您能否告诉我如何解决这个问题,以便重定向到gerrit.mydomain.com并将规范网址更改为http://localhost:80

1 个答案:

答案 0 :(得分:0)

gerrit.canonicalWebUrlhttpd.port配置无关。如果您使用代理服务器(例如nginx或apache)将端口80或443(网络服务器)转发到端口8080(gerrit)

,这是有意义的

您必须编辑gerrit.config并将canonicalWebUrl行调整为它应该的主机名。 您应该能够运行git config -f ~/gerrit_folder/etc/gerrit.config --add gerrit.canonicalWebUrl "http://gerrit.mydomain.com/"

我还强烈建议使用带有ssl的反向代理。