Skip to content

[3.3] Finishing setTrustedProxies() changes & trusted_proxies removal #7952

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 6 commits into from
May 30, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
replace diff code block with PHP code block
  • Loading branch information
xabbuh authored and weaverryan committed May 30, 2017
commit 3632c08ecd259b975e7df2ef456fac73a6b94921
15 changes: 8 additions & 7 deletions request/load_balancer_reverse_proxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ Solution: trusted_proxies
This is no problem, but you *do* need to tell Symfony what is happening
and which reverse proxy IP addresses will be doing this type of thing:

.. configuration-block::
.. code-block:: php

.. code-block:: diff
// web/app.php

// web/app.php
// ...
$request = Request::createFromGlobals();

// ...
$request = Request::createFromGlobals();
+ Request::setTrustedProxies(['127.0.0.1', '10.0.0.0/8']);
// use the setTrustedProxies() method to tell Symfony
// about your reverse proxy IP addresses
Request::setTrustedProxies(['127.0.0.1', '10.0.0.0/8']);

// ...
// ...

In this example, you're saying that your reverse proxy (or proxies) has
the IP address ``192.0.0.1`` or matches the range of IP addresses that use
Expand Down