How to get real IP of user in WordPress when using NginX as proxy

If your wordpress instance is behind an Nginx Proxy, by default you won’t get their real IP. To fix this issue, you will need to update your proxy configuration with the following details: Once updated, restart your nginx service and add the following code in your wp-config.php file. You should now see your visitor’s IP.