开启nginx目录文件列表显示功能
正常访问nginx的时,显示nginx欢迎页,也就是我们目录首页(/nginx/html/index.html文件),不会显示项目目录列表,这对于本人代码也起到一定的保护作用;
但我们在开发阶段为了快速浏览列表,可设置目录列表的【显示】
那么重要的时刻到了-----在nginx.conf主配置文件中http或location代码段中,配置一段代码即可实现:
http {
include mime.types;
default_type application/octet-stream;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
[参数说明]
1、autoindex on; # 自动显示目录 |