Magento Online Customers Showing Local IP Address 127.0.0.1

Sunday, 6. May 2012

Came across this problem where Magento’s online customers are all showing local ip address of 127.0.0.1. After a bit of investigating, the problem was due to the fact that the web server was behind a proxy server.

To get around this problem, Magento has a solution (seen on local.xml.additional file) and all you need to do is add this snippet code below to your current local.xml file inside the global tags.

<global>
    ...
	<remote_addr_headers>
            <header1>HTTP_X_REAL_IP</header1>
            <header2>HTTP_X_FORWARDED_FOR</header2>
        </remote_addr_headers>
     ...  
</global>

Remember to refresh the cache for the changes to take effect then re-visit the online customers again.

Enjoy!

Leave a Reply

You must be logged in to post a comment.