百度已收录

问题

使用CloudFlare后Nginx无法获取用户的真实IP

解决方案

在Nginx配置文件http段配置如下代码后重载配置即可

set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;