Last active
December 12, 2015 04:18
-
-
Save sakama/4712841 to your computer and use it in GitHub Desktop.
ロードバランサー配下にあるApacheでアクセス元IPをX-Forward-Forヘッダから取得してログに出力する方法
アクセス元IPが全てロードバランサーとなることを防ぐ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#変更前 | |
LogFormat "%h %l %u %t \"%r\" %>s %b" common | |
#変更後 | |
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common | |
#変更前 | |
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined | |
#変更後 | |
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment