after using varnish and use Nginx SSL termination for varnish, today I found that all the online customer IP changed to

Apache2 8080 port

Varnish 80 port

Nginx 443 port

location / {
proxy_pass  ;
proxy_read_timeout    90;
proxy_connect_timeout 90;
proxy_redirect        off;

proxy_set_header      X-Real-IP $remote_addr;
proxy_set_header      X-Forwarded-For $remote_addr;
proxy_set_header      X-Forwarded-Proto https;
proxy_set_header      X-Forwarded-Port 443;
proxy_set_header      Host $host;
proxy_set_header X-Nginx on;
proxy_redirect     off;

extension: Turpentine for Varnish

Magento set both secure and unsecured URL to "https://"

enter image description here

how to fix this problem, I want to show the original IP of the customer

1 Answer 1


Try adding this code to local.xml and


magento cache.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.