Skip to content

Commit 869e5d2

Browse files
authored
Making it more clear where to add the Request::setTrustedProxies line
And trying out the diff format!
1 parent 814d8c4 commit 869e5d2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

request/load_balancer_reverse_proxy.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,16 @@ In this case, you'll need to - *very carefully* - trust *all* proxies.
8282

8383
#. Once you've guaranteed that traffic will only come from your trusted reverse
8484
proxies, configure Symfony to *always* trust incoming request. This is
85-
done inside of your front controller::
85+
done inside of your front controller:
86+
87+
.. code-block:: diff
8688
8789
// web/app.php
8890
8991
// ...
90-
Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));
92+
$request = Request::createFromGlobals();
93+
+ Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));
9194
92-
$response = $kernel->handle($request);
9395
// ...
9496
9597
#. Ensure that the trusted_proxies setting in your ``app/config/config.yml``

0 commit comments

Comments
 (0)