3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Gitlabのリダイレクト設定

Last updated at Posted at 2024-06-04

はじめに

Gitlabの移行に伴い、古いサーバのリポジトリにアクセスした場合に新しいサーバのリポジトリにリダイレクトする設定が必要になったので備忘録がてら記述します。

実装

/etc/gitlab/gitlab.rbを編集します。旧サーバのリダイレクトりしたいリポジトリを開き、ドメイン以降のパスを<旧サーバリポジトリ>に記述する。

nginx['custom_gitlab_server_config'] = " location ^~ /<旧サーバリポジトリ> {
    return 301 https://<新サーバドメイン>/リポジトリ;
  }
  "

次に以下コマンドで設定を読み込みなおします。

gitlab-ctl reconfigure

参考文献

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?