Created
May 10, 2018 18:50
-
-
Save christopher-b/7cf281a186b94ded0f91277afe13dc1c to your computer and use it in GitHub Desktop.
Apache - log real IP for proxied requests
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
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 | |
# From http://www.techstacks.com/howto/log-client-ip-and-xforwardedfor-ip-in-apache.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment