I am trying to get client IP with $request->getClientIp();
and it returns 172.19.0.2
, but that is not my public IP.
I stumbled upon this doc to set up trusted proxies so I tried doing like this:
// web/app_dev.php
// ...
$request = Request::createFromGlobals();
// tell Symfony about your reverse proxy
Request::setTrustedProxies(['172.19.0.0/8'], Request::HEADER_X_FORWARDED_ALL);
$response = $kernel->handle($request);
// ...
But that did not fix the issue.
What am I doing wrong?