In short: you always need to use $proxy = true if you plan to use some kind of reverse proxy. If this parameter is set (and trustProxyData(); enabled), $this->getClientIp(); will return the correct IP address with a reverse proxy server.
Explanation: even after configuration, proxy headers return HTTP_X_FORWARDED_FOR or HTTP_CLIENT_IP as the user's IP address, and REMOTE_ADDR returns the local server server address (most likely 127.0.0.1). $proxy = true checks for exactly this. Here is the source code for this function:
public function getClientIp($proxy = false) { if ($proxy) { if ($this->server->has('HTTP_CLIENT_IP')) { return $this->server->get('HTTP_CLIENT_IP'); } elseif (self::$trustProxy && $this->server->has('HTTP_X_FORWARDED_FOR')) { return $this->server->get('HTTP_X_FORWARDED_FOR'); } } return $this->server->get('REMOTE_ADDR'); }
source share