環境
- EC2 m4.large Amazon Linux
- GitLab Community Edition 11.4.5
- ドメイン名 : gitlab.dev
前提! ELB(https:443) -> EC2(http:80)
ELBを使って,GitlabのEC2インスタンスにはhttpでアクセスされるようにしている.
問題!
新規リポジトリを作ろうと思うと,リポジトリのURLがhttps://ip-72-31-31-200となっている!
設定を変更する
gitlabの設定を開く
$ sudo vim /etc/gitlab/gitlab.rb
設定ファイルの中身を変更する
// --/etc/gitlab/gitlab.rbの中身--
// DNSの設定を変更
external_url 'https://gitlab.dev'
// nginxの挙動の設定を変更
nginx['listen_port'] = 80
nginx['listen_https'] = false
nginx['proxy_set_headers'] = {
'X-Forwarded-Proto' => 'https',
'X-Forwarded-Ssl' => 'on'
}
設定を反映
$ sudo gitlab-ctl reconfigure
アクセスできた!
以上.