指定nginx某個目錄顯示目錄結構


1、修改配置文件/usr/local/nginx/conf/nginx.conf

指定目錄,開啟autoindex為on。

 location /study {
     autoindex on;
 }

2、 保存后,重啟nginx服務

先檢查配置文件有沒有問題:

[root@aliyun conf]#/usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

然后重啟nginx服務:

[root@aliyun conf]#/usr/local/nginx/sbin/nginx -s reload

經過這兩步,便配置成功了!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM