- 首先在html目录下新建几个文件
- nginx.conf开启autoindex。
- nginx -s reload
访问网站(不出现目录可以强制刷新)
首先在html目录下新建几个文件
[root@lzh 100]# touch 1.txt
[root@lzh 100]# touch 2.py
[root@lzh 100]# touch 3.sh
index.html记得改名字,不然访问首页还是出现index.html内容
nginx.conf开启autoindex。
autoindex on;
访问网站