Hi,
I’m using Cloudflare CDN, ‘Yii::$app->request->userIP’ gives me an incorrect IP address, the Cloudflare proxy. But I want the client IP Address and don’t know how to get it with Yii2.
Regards
Hi,
I’m using Cloudflare CDN, ‘Yii::$app->request->userIP’ gives me an incorrect IP address, the Cloudflare proxy. But I want the client IP Address and don’t know how to get it with Yii2.
Regards
you need to setup your server for this, check the cloudflare docs on how to do it - https://support.cloudflare.com/hc/en-us/sections/200805497-Restoring-Visitor-IPs
Thanks a lot!
I found a solution here, and it works!