Nginx disables directory browsing after the default installation.
(Recommended tutorial: nginx tutorial)
If you want to enable the directory browsing function, please do the following:
Edit the nginx configuration file nginx.conf
vi /usr/local/nginx/conf/nginx.conf
Add the following content below http:
autoindex on; #开启nginx目录浏览功能,on为开启,off为关闭 autoindex_exact_size on; #显示文件大小从KB显示 autoindex_localtime on #显示文件修改时间,为服务器本地时间
Save the file and exit.
Restart nginx
service nginx reload
Open the browser and enter the address, you can see that the directory browsing function is turned on.
The above is the detailed content of How to enable directory browsing function in nginx. For more information, please follow other related articles on the PHP Chinese website!