1. 首先在html目录下新建几个文件
    2. nginx.conf开启autoindex。
    3. nginx -s reload
    4. 访问网站(不出现目录可以强制刷新)

    5. 首先在html目录下新建几个文件

      1. [root@lzh 100]# touch 1.txt
      2. [root@lzh 100]# touch 2.py
      3. [root@lzh 100]# touch 3.sh

      index.html记得改名字,不然访问首页还是出现index.html内容
      image.png

    6. nginx.conf开启autoindex。

      1. autoindex on;

      image.png

    7. 访问网站

    image.png