系统相关
首页 > 系统相关> > nginx目录索引

nginx目录索引

作者:互联网

安装nginx后修改目录索引

查看我当前的目录
nginx目录索引

修改配置文件 vim /usr/local/nginx/conf/nginx.conf
nginx目录索引

修改为
nginx目录索引

 location / {
            root   /usr/local/nginx;
                autoindex on;
                autoindex_localtime on;

        }
把html删除改成/usr/local/nginx的路径  删除index indel.html index.htm;
增加  autoindex on;
                autoindex_localtime on;
然后 Esc  wq 保存退出

进入到nginx/sbin的目录下 ,启动nginx ,命令是./nginx
关闭防火墙 systemctl stop firewalld
关闭linux防火墙 setenforce 0
nginx目录索引
打开浏览器 访问自己虚拟机ip 出现下面页面 表示成功

标签:autoindex,目录索引,nginx,usr,conf,local
来源: https://blog.51cto.com/14375809/2429150