全球主机交流论坛

标题: 有大佬知道apache 套了cf怎麼獲取真實訪問IP嗎? [打印本页]

作者: httpd    时间: 2025-1-5 19:13
标题: 有大佬知道apache 套了cf怎麼獲取真實訪問IP嗎?
我看了一下午網上公開教學博客帖子等,跟着他們學步步都是apache2的配置文件語法不過關而無法重啓,獲得cf ip列表的腳本也有,但搞來搞去就是無法重啓apache,remoteip這個模塊也是默認裝着的,獲取下來的ip列表文件也是存在的,但就是。。。
作者: httpd    时间: 2025-1-5 19:16
https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/

現在就沒試這個了,但是我看着好麻煩這個,又是該這又是改日志的
作者: dole    时间: 2025-1-5 19:25
Nginx/Caddy https://nezha.wiki/guide/q3.html
作者: httpd    时间: 2025-1-5 19:35
dole 发表于 2025-1-5 19:25
Nginx/Caddy https://nezha.wiki/guide/q3.html

我這程序只會使用apache,我都是nginx流量轉發給apache的
作者: 雅丶涵    时间: 2025-1-5 21:39
日志格式%h改为 %a 配置的最后一行添加 RemoteIPHeader CF-Connecting-IP 保存重启apache即可恢复
作者: httpd    时间: 2025-1-6 16:53
雅丶涵 发表于 2025-1-5 21:39
日志格式%h改为 %a 配置的最后一行添加 RemoteIPHeader CF-Connecting-IP 保存重启apache即可恢复 ...

就是說apache很特殊,不能用自帶的標頭去識別IP,只能用CF的嗎
作者: httpd    时间: 2025-1-6 17:18
雅丶涵 发表于 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
錯誤上
作者: httpd    时间: 2025-1-6 17:50
無法引用文件,但是直接寫入IP是可以正常運行apache的,奇怪了





欢迎光临 全球主机交流论坛 (https://loc.isir333.eu.org/) Powered by Discuz! X3.4