有大佬知道apache 套了cf怎麼獲取真實訪問IP嗎?
我看了一下午網上公開教學博客帖子等,跟着他們學步步都是apache2的配置文件語法不過關而無法重啓,獲得cf ip列表的腳本也有,但搞來搞去就是無法重啓apache,remoteip這個模塊也是默認裝着的,獲取下來的ip列表文件也是存在的,但就是。。。 https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/現在就沒試這個了,但是我看着好麻煩這個,又是該這又是改日志的 Nginx/Caddy https://nezha.wiki/guide/q3.html
https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif
dole 发表于 2025-1-5 19:25
Nginx/Caddy https://nezha.wiki/guide/q3.html
我這程序只會使用apache,我都是nginx流量轉發給apache的 日志格式%h改为 %a 配置的最后一行添加 RemoteIPHeader CF-Connecting-IP 保存重启apache即可恢复
雅丶涵 发表于 2025-1-5 21:39
日志格式%h改为 %a 配置的最后一行添加 RemoteIPHeader CF-Connecting-IP 保存重启apache即可恢复 ...
就是說apache很特殊,不能用自帶的標頭去識別IP,只能用CF的嗎
雅丶涵 发表于 2025-1-5 21:39
日志格式%h改为 %a 配置的最后一行添加 RemoteIPHeader CF-Connecting-IP 保存重启apache即可恢复 ...
我把apache的配置文件該了,但依舊是出在Invalid command 'RemoteIPTrustedProxyFile', perhaps misspelled or defined by a module not included in the server configuration
錯誤上 無法引用文件,但是直接寫入IP是可以正常運行apache的,奇怪了
https://ogp.cc/vKSXE
页:
[1]