Skip to content

Commit b840ee0

Browse files
authored
Add note on Trusted Proxies config when app is behind multiple proxies
I was having the same issue as symfony/symfony#18587
1 parent 9b27b5f commit b840ee0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

deployment/proxies.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ That's it! It's critical that you prevent traffic from all non-trusted sources.
7676
If you allow outside traffic, they could "spoof" their true IP address and
7777
other information.
7878

79+
.. caution::
80+
81+
In case you are also using `CloudFront`_ or another proxy on top of your Load Balancer, calling ``$request->server->get('REMOTE_ADDR')`` as in the above example won't be enough, as it will only whitelist the first level in the chain of trust (in this case your Load Balancer). You need to make sure you also append the IP addresses or ranges of any additional proxy to the array of trusted proxies.
82+
83+
In the case of `CloudFront`_, you can find the list of IPs `at this address <https://ip-ranges.amazonaws.com/ip-ranges.json>`_.
84+
7985
Custom Headers When Using a Reverse Proxy
8086
-----------------------------------------
8187

@@ -94,3 +100,4 @@ In this case, you'll need to set the header ``X-Forwarded-Proto`` with the value
94100

95101
.. _`security groups`: http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html
96102
.. _`CloudFront`: https://en.wikipedia.org/wiki/Amazon_CloudFront
103+
.. _`at this address`_: https://ip-ranges.amazonaws.com/ip-ranges.json

0 commit comments

Comments
 (0)