全球主机交流论坛

标题: 小白问个nginx路径私密访问的问题 [打印本页]

作者: amehime    时间: 2021-12-4 22:55
标题: 小白问个nginx路径私密访问的问题
nginx默认安装,做基本配置,在 /usr/share/nginx/html/ 下放个空白的 index.html ,测试可以访问。
然后在 /usr/share/nginx/html/ 下建一个文件夹,名字随机密码,比如:/usr/share/nginx/html/fdW8EeydRn/, 里面放一些带密码的配置文件,用这种方式: https://域名.com/fdW8EeydRn/config.conf 来访问下载文件。
请问这样操作算正确吗,可不可以起到隐藏 /fdW8EeydRn/ 路径的效果?爬虫扫描的话会不会直接扫描到  /usr/share/nginx/html/ 目录下的所有东西?
作者: heihai    时间: 2021-12-4 23:06
能不能扫得到不知道,但是直接访问路径会Forbidden
作者: nisekoi    时间: 2021-12-4 23:07
扫描不到。只要你没开目录访问就是安全的
作者: amehime    时间: 2021-12-4 23:09
heihai 发表于 2021-12-4 23:06
能不能扫得到不知道,但是直接访问路径会Forbidden

比如在 /usr/share/nginx/html/fdW8EeydRn/ 下放个 config.conf 文件
我试过了,用 wget 或者直接浏览器访问 https://域名.com/fdW8EeydRn/config.conf 都可以下载,只是想了解下这样使用算不算安全
不知道你说的 Forbidden 是什么意思
作者: amehime    时间: 2021-12-4 23:11
nisekoi 发表于 2021-12-4 23:07
扫描不到。只要你没开目录访问就是安全的

目录访问 是什么意思?
nginx里可设置?
作者: sRGB    时间: 2021-12-4 23:32
autoindex on;
作者: heavens    时间: 2021-12-4 23:35
这样不一定安全
作者: NEET姬    时间: 2021-12-4 23:37
宝塔面板的防火墙 有这些功能
作者: 取个什么名好呢    时间: 2021-12-4 23:38
可以在/fdW8EeydRn目录配置个Basic Auth
至于autoindex访问可参考这种页面:
https://111111.online/cloud/
作者: mjj666zzz    时间: 2021-12-4 23:39
本帖最后由 mjj666zzz 于 2021-12-4 23:43 编辑

关掉索引,文件夹别放网站目录里,用
location = /uuid {
alias  /path/to/file;
基本认证也可以开;
}
必须https访问
https://user:passwd@url
作者: amehime    时间: 2021-12-5 01:37
mjj666zzz 发表于 2021-12-4 23:39
关掉索引,文件夹别放网站目录里,用
location = /uuid {
alias  /path/to/file;

感谢,换成 location = /uuid {alias  /path/to/file;} 这种方法




欢迎光临 全球主机交流论坛 (https://hostloc.onozo.cc/) Powered by Discuz! X3.4