Skip to content

Commit 9b2c9f4

Browse files
ruudkwouterj
authored andcommitted
Always use 127.0.0.1 as a trusted proxy
Apparently the behaviour changed in Symfony 2.7. Before, the solution just worked perfectly with a Amazon ELB. After upgrading to Symfony 2.7 the subrequests weren't trusted anymore because they set the `REMOTE_ADDR` to `127.0.0.1`
1 parent 536fa8a commit 9b2c9f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cookbook/request/load_balancer_reverse_proxy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ In this case, you'll need to - *very carefully* - trust *all* proxies.
8383
// web/app.php
8484

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

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

0 commit comments

Comments
 (0)