0

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

Apache2 8080 port

Varnish 80 port

Nginx 443 port

location / {
proxy_pass            http://127.0.0.1;
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

0

Try adding this code to local.xml and

clear/flush

magento cache.

code

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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