Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#concrete5 #5.7 How to work concrete5 behind a load balancer or a reverse proxy
* Always trust incoming request.
* application/config/concrete.php
* For more detail, see:
// Get remote address
$remoteIp = $_SERVER['REMOTE_ADDR'];
return [
'security' => [
'trusted_proxies' => [
'ips' => [$remoteIp]
Copy link

typoman76 commented Jun 7, 2018

Is this still valid for concrete5 8.x?

Copy link

xtedx commented Oct 5, 2018

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.

Copy link

KorvinSzanto commented Aug 30, 2019

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.

Copy link

hissy commented Sep 2, 2019

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