You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Getting the real IP of the client behind a load balancer
2
+
If you use this container behind a proxy or load balancer you might want to get the real IP of the client instead of the IP of the proxy or load balancer.
3
+
4
+
To do this you can add the following configuration to the [Nginx configuration](../config/nginx.conf):
5
+
6
+
```nginx
7
+
set_real_ip_from <CIDR>
8
+
9
+
real_ip_header X-Forwarded-For;
10
+
real_ip_recursive on;
11
+
```
12
+
13
+
Where `<CIDR>` is the CIDR of your proxy or load balancer, see the [Nginx documentation](http://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from). The real IP of the client will now be available in PHP under `$_SERVER['REMOTE_ADDR']`.
0 commit comments