Skip to content

Instantly share code, notes, and snippets.

@potix2
Created December 7, 2011 08:27
Show Gist options
  • Save potix2/1441992 to your computer and use it in GitHub Desktop.
Save potix2/1441992 to your computer and use it in GitHub Desktop.

AWSでELB経由のリクエストに対してIPアドレスによるアクセス制限をかけたい

mod_extract_forwardedを使うといつも通りのアクセス制限が可能。

$sudo yum --enablerepo=epel install mod_extract_forwarded
$sudo vi /etc/httpd/conf.d/mod_extract_forwarded.conf

ファイルに下記設定を追加する。

MEFaccept all #追加

設定完了後、configtestを実施して再起動。

$sudo /etc/init.d/httpd configtest
$sudo /etc/init.d/httpd restart

注意点

mod_proxyをロードしておかないとconfigtestの段階でエラーがでる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment