nginx目錄索引

安裝nginx後修改目錄索引html

查看我當前的目錄
nginx目錄索引linux

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

修改成
nginx目錄索引vim

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 出現下面頁面 表示成功瀏覽器

相關文章
相關標籤/搜索