LoginSignup
0
0

More than 3 years have passed since last update.

GitLab CE(Community Edition)にBasic認証をかける

Posted at

前提

・GitLab CE導入済み
・httpd-toolsなどで.htpasswdを作成できる

設定方法

cat /var/opt/gitlab/nginx/conf/gitlab-http.conf

すると、内容が表示されるので

  location / {
   proxy_cache off;
   proxy_pass  http://gitlab-workhorse;
 }

となっているところに追記する。
具体的には

  location / {
   proxy_cache off;
   proxy_pass  http://gitlab-workhorse;
   auth_basic "Restricted";
   auth_basic_user_file /var/opt/gitlab/nginx/conf/.htpasswd;
 }

などとする。

上記で指定したディレクトリ

/var/opt/gitlab/nginx/conf/

にhttpd-toolsやここを使って.htpasswdを作成する。
パーミッションは604。

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