Files
SimpleNav/deploy/nginx-simplenav-deny-data.conf
T

15 lines
795 B
Plaintext
Raw Normal View History

# SimpleNav 安全规则:禁止通过 Web 访问数据库等敏感目录
# 用法:把下面几行加入宝塔站点 n.yangyq.net 的 nginx server{} 块中,然后 reload nginx。
# (放在 /simplenav 子目录部署时用第一条;以后放根目录时用第二组。)
# —— 子目录部署(当前测试阶段)——
location ~ ^/simplenav/data/ { deny all; return 404; }
location ~ ^/simplenav/\.git/ { deny all; return 404; }
# —— 以后放到根目录时启用 ——
# location ~ ^/data/ { deny all; return 404; }
# location ~ ^/\.git/ { deny all; return 404; }
# 可选:禁止 uploads 目录执行脚本(防上传木马)
location ~* ^/simplenav/uploads/.*\.(php|phtml|phar)$ { deny all; return 404; }