我想使用Matomo (自托管跟踪软件,类似于谷歌分析)。JS代码片段公开了一个调用来进行跟踪的PHP文件(例如,请参见here )。此PHP文件与用于登录的文件和其他文件位于同一文件夹中,即这会向恶意爬虫程序暴露太多信息。因此,我想通过一个不存在的或误导性的路径代理PHP文件的URL。例如。
不安全:
_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。
这有可能吗?谢谢你的建议!
发布于 2019-09-26 06:29:16
请尝试Matomo Tracker Proxy https://github.com/matomo-org/tracker-proxy
发布于 2019-09-22 23:33:44
未经测试。
location ~ ^/external/matomo\.php$
{
…
}
location ~ ^/hidden_blablahblahblablubb/(?:index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs)\.php$
{
…
}如果matomo.php需要其他文件,您可以使用更多(已命名的)location,或许还可以将Nginx位置命令internal与rewrite结合使用。
https://stackoverflow.com/questions/58050388
复制相似问题