【问题标题】:Allow IP through htaccess using Cloudflare Proxy使用 Cloudflare 代理通过 htaccess 允许 IP
【发布时间】:2020-07-10 07:53:48
【问题描述】:

我正在使用

Allow from 123.234.12.23

无需输入 htpasswd 凭据即可将 IP 地址列入白名单。

我刚刚切换到使用 Cloudflare 代理(以保护绕过 CF 防火墙),但现在对我的服务器的所有请求(来自 Apache 日志)都作为 Cloudflare IP 进入。


如果我在白名单 IP 上,我如何访问请求者的实际 IP,这样我就不必继续输入凭据?

【问题讨论】:

    标签: apache proxy ip apache2 cloudflare


    【解决方案1】:

    为此,您需要为 Apache 安装 mod_cloudflare

    https://support.cloudflare.com/hc/en-us/articles/200170916-Restoring-original-visitor-IPs-Option-1-Installing-mod-cloudflare


    由于我的机器在 Ubuntu 上运行,我最终按照 this site 的指南在 Ubuntu 上安装它。

    【讨论】:

    • mod_cloudflare 自 Ubuntu 16.04 LTS (2016) 起不再支持。你应该改用mod_remoteip
    • @BadHorsie 我确实使用它,我从来没有机会更新我的答案......
    猜你喜欢
    • 2016-09-29
    • 1970-01-01
    • 2011-05-22
    • 1970-01-01
    • 2016-09-05
    • 1970-01-01
    • 1970-01-01
    • 2013-02-01
    • 2016-02-17
    相关资源
    最近更新 更多