小编Pik*_*nik的帖子

nginx。拒绝 URL 中任意位置的两点

我需要配置 nginx 服务器,如果 URL 在 URL 中的任何位置包含两点(..),他就会显示 403 页。例如,如果 URL 是“site.sit/index.php?log=../conf.php - web-server 应该检测到尝试去上面的目录并引入 403-messege。我尝试在 conf 中配置这个想法-file nginx 那里:

location \.\. {
    deny all;
    }
Run Code Online (Sandbox Code Playgroud)

但这行不通。

告诉我,我如何实施这个计划?

nginx

3
推荐指数
1
解决办法
574
查看次数

标签 统计

nginx ×1