Home > Article > Operation and Maintenance > How to enable Nginx directory browsing function
We all know that under apache, you can configure a certain path to access the web server to automatically display the file list under the directory. In fact, nginx is not weaker than apache at all. Of course, it can also implement this function, and it is very easy. and simple; mainly use the autoindex parameter to enable it, and its configuration is as follows:
Copy code The code is as follows:
location / {
root /data/www/file /Specify the absolute path to the actual directory;
autoindex on; autoindex_localtime on; // Turn on the server's local time zone to display the file modification date!
}
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. The nginx directory browsing rendering is:
The above is the detailed content of How to enable Nginx directory browsing function. For more information, please follow other related articles on the PHP Chinese website!