【发布时间】:2019-09-22 14:56:47
【问题描述】:
我想使用 Matomo(自托管跟踪软件,类似于 Google Analytics)。 JS sn-p 公开了一个 PHP 文件,该文件被调用以进行跟踪(例如,参见 here)。此 PHP 文件与登录文件和其他文件位于同一文件夹中,即这会为恶意爬虫暴露太多信息。因此,我想通过不存在或误导性的路径将 URL 代理到 PHP 文件。例如
不安全:
_paq.push(['setTrackerUrl', u+'https://www.mytracker.com/exposed_installation/matomo.php']);
应该变得更安全:
_paq.push(['setTrackerUrl', u+'https://www.mytracker.com/non-existing-path/matomo.php']);
所以这样爬虫只能看到跟踪脚本文件,但其他一切都会导致 404。
这可能吗?感谢您的任何建议!
【问题讨论】:
-
我会很刻薄。我在您的帖子中看到两个问题。两者都可以回答是。
-
@Yanis-git 谢谢。据我判断,这仅保护内部文件,但仍允许爬虫查看登录页面等,请参阅
location ~ ^/(index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs)\.php { -
@qräbnö 好吧,那我也很刻薄,邀请你回答这两个问题。