Skip to content

Commit e5c2df4

Browse files
authored
Merge pull request #689 from ExpressionEngine/feature/7.x/get-ip-behind-load-balancer
docs on using reverse proxy / load balancers
2 parents 77e1e03 + 0eb5477 commit e5c2df4

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

docs/config/config-files.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ These are the mime types that are allowed to be uploaded using the upload class.
4343

4444
The mime types are grouped by file type. You can add the allowed mime types directly or you can add new file types containing miltiple mimes.
4545

46+
#### Reverse Proxy IP addresses
47+
48+
`proxy.php`
49+
50+
If the server is behind a reverse proxy or load balancer the system will need special configuration to discover a user's real IP address. If the IP address passed along by the server matches a value or range specificed in this configuration file the system will look at the request headers to determine the real IP address.
51+
52+
Please consult with the provider of your reverse proxy or load balancing solutions for the IP addresses or ranges to use. Some providers will let you know the exact IP address of the load balancer, while others will give you a range. Here are the links with information for some common providers: [CloudFlare](https://www.cloudflare.com/ips/), [Google Cloud](https://cloud.google.com/load-balancing/docs/https/#firewall_rules), [AWS Elastic](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html)
53+
4654
#### 'Remember me' expiration
4755

4856
`remember.php`

docs/general/system-configuration-overrides.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,7 @@ Example Usage:
21992199
### `proxy_ips`
22002200

22012201
Allow list of reverse proxy servers that may forward the visitor's IP address.
2202+
DEPRECATED. Use [`proxy.php` config file](config/config-files.md#reverse-proxy-ip-addresses) instead.
22022203

22032204
| Value | Description |
22042205
| ------------ | ------------------------------------ |

docs/optimization/handling-extreme-traffic.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,9 @@ These can be disabled in your Control Panel [Tracking Preferences](control-panel
5454
ExpressionEngine's caching mechanisms can help reduce database load in most situations. However if you use file-based caching, that may transfer some of the resources saved from the database server to the web server. Thus, it is recommended that you use either the Memcached or Redis [caching driver](optimization/caching.md#caching-drivers) instead of the file driver, especially on high-traffic sites. The increased disk i/o from file caches being created and destroyed during a high traffic event consumes significantly more server resources than the memory-based caching drivers.
5555

5656
If you are running in a PHP environment without Opcode caching, [saving templates as files](general/system-configuration-overrides.md#save_tmpl_files) can marginally increase disk i/o as each template must be retrieved from disk. We recommend running PHP 7 or greater so that this type of file activity is managed better by the server.
57+
58+
## Using Load Balancers
59+
60+
Using a load balancer or reverse proxy is a popular solution to mitigate DDoS attacks and make handling large amounts of traffic easier.
61+
62+
When a server is placed behind a reverse proxy or load balancer ExpressionEngine might not know the user's real IP address because it would be substituted with the proxy's IP address. Most proxies however will preserve the real user's IP address and forward it through a request header. In order to use the data in those headers to obtain the real user's IP address you need to configure the system to recognize and trust the proxy IP addresses. This can be done using the [`proxy.php` configuration file](config/config-files.md#reverse-proxy-ip-addresses).

0 commit comments

Comments
 (0)