Magento online customer shows 127.0.0.1 instead of real IP address

Tuesday, 10. April 2012

Came across this issue today when client mentioned after the move to new server all of a sudden all online customers IP address were showing as 127.0.0.1 instead of their correct IP address.

This is a proxy issue and the best solution lies within the local.xml.additional file.

Basically you will need this snippet text below added to you local.xml file just before the closing of the tag

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

Make sure you FLUSH MAGENTO CACHE to see changes.

Enjoy :)

Leave a Reply

You must be logged in to post a comment.