Normal access Nginx words is to display the Nginx Welcome page, that is,/nginx/html/index.html file;
If you want to display all the files in the/html/directory, you need to open the directory file list display;
In the nginx.conf master configuration file in the HTTP or Location code snippet, configure a piece of code can be implemented;
Examples are as follows (green code):
HTTP {
Include Mime.types;
Default_type Application/octet-stream;
AutoIndex on;
Autoindex_exact_size off;
Autoindex_localtime on;
AutoIndex on; automatic display of catalogs
Autoindex_exact_size off;
The default is on to show the exact size of the file, in bytes.
After change to off, the approximate size of the file is displayed, in kilobytes or MB or GB
Autoindex_localtime on;
The default is off, and the file time displayed is GMT time.
When on, the file time displayed is the server time of the file
Autoindex_exact_size on; Open the actual size of the display file, in bytes;
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s1.51cto.com/wyfs02/m02/80/59/wkiol1c-jfxa2d_yaabvqaadypk731.jpg "title=" 1.jpg "alt=" wKioL1c-jfXA2D_ Yaabvqaadypk731.jpg "/>
Autoindex_exact_size off; Displays the approximate size of the file when it is closed, in kilobytes or MB or GB, as
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s4.51cto.com/wyfs02/m00/80/59/wkiol1c-jemtz72-aabx8z7h-r4365.jpg "title=" 2.jpg "alt=" Wkiol1c-jemtz72-aabx8z7h-r4365.jpg "/>
This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://mofansheng.blog.51cto.com/8792265/1775350
Open Nginx catalog File list display function