Real IP address


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 :slight_smile:

you need to setup your server for this, check the cloudflare docs on how to do it -

Thanks a lot!

I found a solution here, and it works!