汕头网站开发定制,北京哪里制作网站,县级门户网站建设的报告,免费建网站 步骤一、前言
最近被扫描到安全漏洞#xff0c;说是nginx启用了自动目录列表功能#xff0c;现象就是访问http://localhost/file就能看到服务器上的目录
二、修复方法
1.把nginx.conf中的autoindex on改为autoindex off
location /file {alias /myuser/userfile/file;autoi…一、前言
最近被扫描到安全漏洞说是nginx启用了自动目录列表功能现象就是访问http://localhost/file就能看到服务器上的目录
二、修复方法
1.把nginx.conf中的autoindex on改为autoindex off
location /file {alias /myuser/userfile/file;autoindex off;}这个配置映射到了服务器的file目录下如果是on就会看到目录改为off就可以了
2.重启nginx
sudo nginx -s reload
nginx -s reload三、备注
Nginx 中默认不会开启目录浏览功能若您发现当前已开启该功能可以编辑nginx.conf文件删除如下两行autoindex on;autoindex_exact_size on然后重启Nginx。