8000 Remove deprecated trusted_proxies config option · richard4339/symfony-docs@1825c83 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1825c83

Browse files
JarJakweaverryan
authored andcommitted
Remove deprecated trusted_proxies config option
1 parent df63034 commit 1825c83

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

request/load_balancer_reverse_proxy.rst

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,19 @@ and which reverse proxy IP addresses will be doing this type of thing:
2525

2626
.. configuration-block::
2727

28-
.. code-block:: yaml
29-
30-
# app/config/config.yml
31-
# ...
32-
framework:
33-
trusted_proxies: [192.0.0.1, 10.0.0.0/8]
34-
35-
.. code-block:: xml
36-
37-
<!-- app/config/config.xml -->
38-
<?xml version="1.0" encoding="UTF-8" ?>
39-
<container xmlns="http://symfony.com/schema/dic/services"
40-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
41-
xmlns:framework="http://symfony.com/schema/dic/symfony"
42-
xsi:schemaLocation="http://symfony.com/schema/dic/services
43-
http://symfony.com/schema/dic/services/services-1.0.xsd
44-
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
28+
.. code-block:: diff
4529
46-
<framework:config trusted-proxies="192.0.0.1, 10.0.0.0/8">
47-
<!-- ... -->
48-
</framework:config>
49-
</container>
30+
// web/app.php
5031

51-
.. code-block:: php
32+
// ...
33+
$request = Request::createFromGlobals();
34+
+ Request::setTrustedProxies(['127.0.0.1', '10.0.0.0/8']);
5235

53-
// app/config/config.php
54-
$container->loadFromExtension('framework', array(
55-
'trusted_proxies' => array('192.0.0.1', '10.0.0.0/8'),
56-
));
36+
// ...
5737

5838
In this example, you're saying that your reverse proxy (or proxies) has
5939
the IP address ``192.0.0.1`` or matches the range of IP addresses that use
60-
the CIDR notation ``10.0.0.0/8``. For more details, see the
61-
:ref:`framework.trusted_proxies <reference-framework-trusted-proxies>` option.
40+
the CIDR notation ``10.0.0.0/8``.
6241

6342
You are also saying that you trust that the proxy does not send conflicting
6443
headers, e.g. sending both ``X-Forwarded-For`` and ``Forwarded`` in the same

0 commit comments

Comments
 (0)
0