httpd 发表于 2025-1-5 19:13:01

有大佬知道apache 套了cf怎麼獲取真實訪問IP嗎?

我看了一下午網上公開教學博客帖子等,跟着他們學步步都是apache2的配置文件語法不過關而無法重啓,獲得cf ip列表的腳本也有,但搞來搞去就是無法重啓apache,remoteip這個模塊也是默認裝着的,獲取下來的ip列表文件也是存在的,但就是。。。

httpd 发表于 2025-1-5 19:16:32

https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/<br />
<br />
現在就沒試這個了,但是我看着好麻煩這個,又是該這又是改日志的

dole 发表于 2025-1-5 19:25:01

Nginx/Caddy https://nezha.wiki/guide/q3.html<img id="aimg_x16OG" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" />

httpd 发表于 2025-1-5 19:35:48

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16170683&ptid=1380357" target="_blank"><font color="#999999">dole 发表于 2025-1-5 19:25</font></a></font><br />
Nginx/Caddy https://nezha.wiki/guide/q3.html</blockquote></div><br />
我這程序只會使用apache,我都是nginx流量轉發給apache的

雅丶涵 发表于 2025-1-5 19:25:00

日志格式%h改为 %a 配置的最后一行添加 RemoteIPHeader CF-Connecting-IP 保存重启apache即可恢复

httpd 发表于 2025-1-5 21:39:55

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16170900&ptid=1380357" target="_blank"><font color="#999999">雅丶涵 发表于 2025-1-5 21:39</font></a></font><br />
日志格式%h改为 %a 配置的最后一行添加 RemoteIPHeader CF-Connecting-IP 保存重启apache即可恢复 ...</blockquote></div><br />
就是說apache很特殊,不能用自帶的標頭去識別IP,只能用CF的嗎

httpd 发表于 2025-1-6 16:53:10

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16170900&ptid=1380357" target="_blank"><font color="#999999">雅丶涵 发表于 2025-1-5 21:39</font></a></font><br />
日志格式%h改为 %a 配置的最后一行添加 RemoteIPHeader CF-Connecting-IP 保存重启apache即可恢复 ...</blockquote></div><br />
我把apache的配置文件該了,但依舊是出在Invalid command 'RemoteIPTrustedProxyFile', perhaps misspelled or defined by a module not included in the server configuration<br />
錯誤上

httpd 发表于 2025-1-5 21:39:00

無法引用文件,但是直接寫入IP是可以正常運行apache的,奇怪了<br />
<img id="aimg_bqZAf" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" width="495" height="536" src="https://ogp.cc/vKSXE" border="0" alt="" />
页: [1]
查看完整版本: 有大佬知道apache 套了cf怎麼獲取真實訪問IP嗎?