且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何更改 nginx 站点 url

更新时间:2023-11-26 23:18:40

更新: GitLab 现在对相对 URL 和专用文档有更好的支持:

Update: GitLab now has better support for relative URLs and dedicated documentation:

您想在相对 url 中移动 GitLab.请记住,除了 nginx 配置之外,您还必须更改其他 3 个地方的 url.请参阅 gitlab.yml 中的说明:

You want to move GitLab in a relative url. Bear in mind that except for the nginx config, you must also change the url in 3 other places. See the directions in gitlab.yml:

# Uncomment and customize the last line to run in a non-root path
# WARNING: This feature is known to work, but unsupported
# Note that three settings need to be changed for this to work.
# 1) In your application.rb file: config.relative_url_root = "/gitlab"
# 2) In your gitlab.yml file: relative_url_root: /gitlab
# 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab"

所有这些配置都在 /home/git/gitlab/config 下.

All these configs are under /home/git/gitlab/config.