10000 feature #12384 Documented the new REMOTE_ADDR option (javiereguiluz) · symfony/symfony-docs@dd8ff15 · GitHub
[go: up one dir, main page]

Skip to content

Commit dd8ff15

Browse files
committed
feature #12384 Documented the new REMOTE_ADDR option (javiereguiluz)
This PR was squashed before being merged int 8000 o the 4.4 branch (closes #12384). Discussion ---------- Documented the new REMOTE_ADDR option Fixes #12382. @mcfedr @stof @nicolas-grekas please review this carefully and tell me if we should add or remove anything else from this article. Thanks! Commits ------- c8e9ff5 Documented the new REMOTE_ADDR option
2 parents 539ec5e + c8e9ff5 commit dd8ff15

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

deployment/proxies.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,18 @@ In this case, you'll need to - *very carefully* - trust *all* proxies.
6565

6666
// ...
6767
Request::setTrustedProxies(
68-
// trust *all* requests
69-
['127.0.0.1', $request->server->get('REMOTE_ADDR')],
68+
// trust *all* requests (the 'REMOTE_ADDR' string is replaced at
69+
// run time by $_SERVER['REMOTE_ADDR'])
70+
['127.0.0.1', 'REMOTE_ADDR'],
7071

7172
// if you're using ELB, otherwise use a constant from above
7273
Request::HEADER_X_FORWARDED_AWS_ELB
7374
);
7475

76+
.. versionadded:: 4.4
77+
78+
The support for the ``REMOTE_ADDR`` option was introduced in Symfony 4.4.
79+
7580
That's it! It's critical that you prevent traffic from all non-trusted sources.
7681
If you allow outside traffic, they could "spoof" their true IP address and
7782
other information.

0 commit comments

Comments
 (0)
0