Created
February 9, 2017 17:48
-
-
Save alvarow/b59eb178127c2aa416987a64db1a530e to your computer and use it in GitHub Desktop.
Sets Apache Log of the X-Forwarded-For client IP address or the real client ip address if the X-Forwarded-For header does not exist.
This file contains 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
# Log the X-Forwarded-For client IP address or the real client ip address if the X-Forwarded-For header does not exist. | |
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\"" proxy | |
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded | |
CustomLog "logs/access_log" combined env=!forwarded | |
CustomLog "logs/access_log" proxy env=forwarded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment