15
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ELB配下のEC2でBasic認証をかける(特定IPを除く)

Last updated at Posted at 2014-12-14
###LBのヘルスチェックを許可
###ロードバランサからのアクセスはX-Forwarded-Forは空
SetEnvIf X-Forwarded-For "^$" empty_ok
Order Deny,Allow
Deny from all
Allow from env=empty_ok

###LBのヘルスチェック以外の特定IPを許可
###グローバルIPでもOK
SetEnvIf X-Forwarded-For "192.168.0." ip_ok
Order Deny,Allow
Deny from all
Allow from env=ip_ok

###上記以外のベーシック認証
AuthType Basic
AuthDBUserFile /var/www/.htpasswd
AuthName "Please input your Password"
Require valid-user

###LB・IP・BASIC認証いずれかOKなら
Satisfy Any

Webで拾ってきた情報を自分用にメモ

15
17
2

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
15
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?