Nginx中获取真实ip地址

location / {

proxy_pass http://localhost;

proxy_set_header Host $host;

          proxy_set_header X-Real-IP $remote_addr;

          proxy_set_header REMOTE-HOST $remote_addr;

          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

原文地址:https://www.cnblogs.com/chuhongyun/p/11419140.html