Last active
September 2, 2019 02:47
-
-
Save hissy/bdb2c63c0b8f29ca1494 to your computer and use it in GitHub Desktop.
#concrete5 #5.7 How to work concrete5 behind a load balancer or a reverse proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Always trust incoming request. | |
* | |
* application/config/concrete.php | |
* | |
* For more detail, see: http://symfony.com/doc/current/cookbook/request/load_balancer_reverse_proxy.html | |
*/ | |
// Get remote address | |
$remoteIp = $_SERVER['REMOTE_ADDR']; | |
return [ | |
'security' => [ | |
'trusted_proxies' => [ | |
'ips' => [$remoteIp] | |
], | |
], | |
]; |
Is this still valid for concrete5 8.x?
yes, i just tried it on concrete5 8.4 running on nginx 1.10.3 and works as expected. no more session expired issues.
This gist can be dangerous! It's far better to configure the actual IPs you expect to proxy your connections rather than just allowing anyone to proxy you.
Yes, this gist can be dangerous. Please read the Symfony doc in the comment.
Some reverse proxies (like AWS Elastic Load Balancing) don't have a static IP address or even a range that you can target with the CIDR notation. In this case, you'll need to - very carefully - trust all proxies.
Configure your web server(s) to not respond to traffic from any clients other than your load balancers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this still valid for concrete5 8.x?