Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Making it more clear where Request::setTrustedProxies should go #7619

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
Mar 15, 2017
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
8 changes: 5 additions & 3 deletions request/load_balancer_reverse_proxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ In this case, you'll need to - *very carefully* - trust *all* proxies.

#. Once you've guaranteed that traffic will only come from your trusted reverse
proxies, configure Symfony to *always* trust incoming request. This is
done inside of your front controller::
done inside of your front controller:

.. code-block:: diff

// web/app.php

// ...
Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));
$request = Request::createFromGlobals();
+ Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));

$response = $kernel->handle($request);
// ...

#. Ensure that the trusted_proxies setting in your ``app/config/config.yml``
Expand Down