When running CakePHP behind a reverse proxy (Docker, nginx, Cloudflare, etc.), using env('REMOTE_ADDR') directly returns the proxy's internal IP instead of the real client IP. The fix involves using ServerRequest::clientIp() with a TrustedProxyMiddleware that reads X-Forwarded-For headers from configured trusted proxy IP

5m read timeFrom dereuromark.de
Post cover image

Sort: