LoginSignup
0
0

More than 5 years have passed since last update.

apache 2.4 httpd.conf 設定

Last updated at Posted at 2017-03-19

apache 2.4 httpd.conf

ロギング

ELBのIPではなく接続元のIPを保存

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" elbcombined

ELBからのヘルスチェック、ダミーコネクション、画像などのロギングをメインのログには出力しない。出力しなかったログを個別にロギング。

SetEnvIf User-Agent "ELB-HealthChecker/2\.0" nolog
SetEnvIf User-Agent "ELB-HealthChecker/2\.0" nologelb
SetEnvIf User-Agent "internal dummy connection" nolog
SetEnvIf Request_URI "\.(gif|jpg|png|css|ico|js)$" nolog
SetEnvIf Request_URI "\.(gif|jpg|png|css|ico|js)$" nologcss
CustomLog "logs/access_log" elbcombined env=!nolog
CustomLog "logs/elb_access_log" elbcombined env=nologelb
CustomLog "logs/css_access_log" elbcombined env=nologcss

セキュア設定

TraceEnable off
ServerTokens Prod
Header always unset X-Powered-By
RequestHeader unset Proxy
Header append X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options nosniff
Header always unset Etag

HTTP Strict Transport Security(HSTS)を有効にする設定(追記 1/25)

Header set Strict-Transport-Security "max-age=31536000;"
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