We all know that when accessing a certain path of the web server under apache, it can automatically display the file list under the directory. In fact, Nginx is not weaker than apache at all. Of course, it can also achieve this function, and it is very easy and simple. ;Mainly use the autoindex parameter to enable it, and its configuration is as follows:
Copy the code The code is as follows:
location / {
autoindex on ; ; Turn on displaying file modification dates in the server's local time zone!
}
After the above configuration, use IE to access the root directory of the server, and a list of all files in the /data/www/file directory will be displayed. Nginx directory browsing renderings:
![]() |
out out out out out off off off off off out off out out out out out out together out out outole out out out out out out out out out out ote to s t-- --- s t s t t s t t s t t s t t s t t s t t t; article/48239.htm