Hi, the X-Real-IP should be in X-Forwarded-For, or part of X-Forwarded-For
to confirm this, you can create a phpinfo page and check
_SERVER["HTTP_X_FORWARDED_FOR"]
to let the value of X-Real-IP header seen by php script, you can add a rewrite rule in .htaccess
RewriteCond %{HTTP:X-Real-IP}...