我已經安裝了最新的Gitlab-CE(8.10)在CentOS 7(全新安裝)通過總括包默認Gitlab端口:https://about.gitlab.com/downloads/#centos7改變,因爲這裏所描述
現在,我想更改默認端口爲哪一個可以訪問Gitlab網頁界面。爲此,我跟着指示在http://docs.gitlab.com/omnibus/settings/nginx.html#change-the-default-port-and-the-ssl-certificate-locations,即我的配置文件/etc/gitlab/gitlab.rb
在包括
external_url "http://127.0.0.1:8765"
,然後用gitlab-ctl reconfigure && gitlab-ctl restart
更新配置。然而,當我然後導航到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」,「幫助」)都包含端口規範。
爲了解決這個問題,是否有必要在/etc/gitlab/gitlab.rb
以外的地方指定端口?
奇怪:https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1210/diffs應該有固定的這個重新正確配置以及頭? (http://docs.gitlab.com/omnibus/settings/nginx.html#change-the-default-port-and-the-ssl-certificate-locations) – VonC
@VonC有趣的是,根據你的建議,我只是取消註釋'/ etc/gitlab/gitlab.rb'中的'nginx ['proxy_set_headers']'的默認設置(也將'X-Forwarded-Proto'改爲'http'並移除'X-Forwarded-Ssl'),並突然它作品!我一定誤解了文檔,似乎表明唯一需要修改的是'external_url'。 – ewcz
幹得好!我添加了一個答案,使文檔的特定部分更加明顯。 – VonC