apache获取nginx反向代理或CDN访客真实IP

Apache旧版用rpaf_module获取反向代理真实IP,在Apache2.2之后就支持mod_remoteip模块,在Apache2.4之后就内置mod_remoteip模块更方便。

#查看是否已加载mod_remoteip模块
apachectl -l | grep mod_remoteip
返回以下内容说明已加载mod_remoteip模块
mod_remoteip.c