Add logging of real remote IP - in case of proxies #138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extends logging to capture
X-Forwarded-For
header (in case of proxies)Description
When server is used behind reverse proxy, reported
remote_addr
reflects internal interface and port, not client external IP. This PR adds additionalreal_remote_ip
that is filled with contents of X-Forwarded-ForMotivation and Context
Main motivation is enable logs to be used with web statistics tools (like AWStats) that require IP addresses to be present in log files
How Has This Been Tested?
Tested by providing (or not) X-Forwarded-For header with Postman