Feat: Explicitly set fastcgi_params #979
Merged
+4
−0
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.
When looking to correctly surface true client IP with a number of reverse proxies in the mix we need access to the
X_FORWARDED_FOR
header in Drupal. With the default configuration this presents as a single IP address for the last hop in the chain:With this change we explicitly set
X_FORWARDED_FOR
and other useful request identifiers back via fastcgi_params. This allows us to usereverse_proxy_addresses
correctly in Drupal (and other applications analogs) to correctly act on the true client IP.With this change PHP sees the following:
$proxy_add_x_forwarded_for
appends theremote_addr
to the IP list to allow us to access that information. PHP currently does not see the value set in theproxy_set_header
and this was the only way I was able to surface this to PHP.