让nginx可以以列表形式显示目录文件

1、编辑/etc/nginx/nginx.conf,让nginx可以以列表形式显示目录文件。

location / {
                root /mnt/software;		#我们需要显示的目录
                autoindex on;			#以列表信息显示目录文件
                index index.html index.htm;
                charset utf-8;
        }

2、修改了nginx的配置文件,重新加载一下nginx。

nginx -s reload
posted @ 2022-12-29 18:57  Flyoung  阅读(218)  评论(0编辑  收藏  举报