LoginSignup
3
0

More than 5 years have passed since last update.

HTTPS化 - AWS EC2にてGitlabを動かす 2019

Posted at

ScrShot_NoName_2019-4-4_15-7-25_No-00.jpg

環境

  • 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

アクセスできた!

ScrShot_NoName_2019-4-4_15-7-57_No-00.jpg

以上.

3
0
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
0