Skip to content

Commit f4e3dd3

Browse files
committed
feature #20238 [HttpFoundation] Document the PRIVATE_SUBNETS string (javiereguiluz)
This PR was merged into the 7.2 branch. Discussion ---------- [HttpFoundation] Document the PRIVATE_SUBNETS string Fixes #20192. Commits ------- d971cea [HttpFoundation] Document the PRIVATE_SUBNETS string
2 parents fb0ab9c + d971cea commit f4e3dd3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

deployment/proxies.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,17 @@ In this case, you'll need to - *very carefully* - trust *all* proxies.
143143
framework:
144144
# ...
145145
# trust *all* requests (the 'REMOTE_ADDR' string is replaced at
146-
# run time by $_SERVER['REMOTE_ADDR'])
146+
# runtime by $_SERVER['REMOTE_ADDR'])
147147
trusted_proxies: '127.0.0.1,REMOTE_ADDR'
148148
149+
# you can also use the 'PRIVATE_SUBNETS' string, which is replaced at
150+
# runtime by the IpUtils::PRIVATE_SUBNETS constant
151+
# trusted_proxies: '127.0.0.1,PRIVATE_SUBNETS'
152+
153+
.. versionadded:: 7.2
154+
155+
The support for the ``'PRIVATE_SUBNETS'`` string was introduced in Symfony 7.2.
156+
149157
That's it! It's critical that you prevent traffic from all non-trusted sources.
150158
If you allow outside traffic, they could "spoof" their true IP address and
151159
other information.

0 commit comments

Comments
 (0)