如果网站走CDN。必须在settings.php设置1$conf['reverse_proxy'] = TRUE;
1
$conf['reverse_proxy'] = TRUE;
这样才可以获取到客户端的真实IP。