Skip to content

[HttpFoundation] Document the PRIVATE_SUBNETS string #20238

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

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion deployment/proxies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,17 @@ In this case, you'll need to - *very carefully* - trust *all* proxies.
framework:
# ...
# trust *all* requests (the 'REMOTE_ADDR' string is replaced at
# run time by $_SERVER['REMOTE_ADDR'])
# runtime by $_SERVER['REMOTE_ADDR'])
trusted_proxies: '127.0.0.1,REMOTE_ADDR'

# you can also use the 'PRIVATE_SUBNETS' string, which is replaced at
# runtime by the IpUtils::PRIVATE_SUBNETS constant
# trusted_proxies: '127.0.0.1,PRIVATE_SUBNETS'

.. versionadded:: 7.2

The support for the ``'PRIVATE_SUBNETS'`` string was introduced in Symfony 7.2.

That's it! It's critical that you prevent traffic from all non-trusted sources.
If you allow outside traffic, they could "spoof" their true IP address and
other information.
Expand Down
Loading