Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Trust all remote proxies #1866

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nyholm
Copy link
Contributor

@Nyholm Nyholm commented Sep 28, 2024

Using Lift and a custom domain, you need to trust all proxies in order to make it work properly.

This is because Symfony will never see Cloudfront URL because we are using the end client IP here: https://github.com/brefphp/bref/blob/master/src/Event/Http/Psr7Bridge.php#L44

If we set this the 127.0.0.1 instead, it would work for Symfony with trusted_proxies: 127.0.0.1. But that will obviously not work for other users expecing this to be the end client IP.

We could specify $_SERVER['REMOTE_ADDR'] to be either the proxy or 127.0.0.1. If so, you would configure trusted_proxies: 127.0.0.1, REMOTE_ADDR. See Symfony Request

The $_SERVER['REMOTE_ADDR'] is currently undefined.


I am not 100% this suggestion is safe, so we should probably use $_SERVER['REMOTE_ADDR'], but that also feels wrong. I would be happy to get some input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant