Open Nginx catalog File list display function

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.