Nginx Index Directory Configuration

Source: Internet
Author: User

To simply share files, some people use SVN, others use FTP, but more people use the index feature. Apache has a powerful index, and is also the most common, nginx auto_index implementation of the directory index is small, and the function is very simple. Let's take a look at what we have.

Nginx Auto_index Index

nginx Configuration

 
1 2 3 4 5 Location ~ ^/2589(/. *)        { autoindex on; //Open autoindex_localtime on; Turn on display function         }

auto_index Directive
syntax: AutoIndex   on  |  off ;
configuration segment:  
1 autoindex off
http ,   server ,   location

Enable/Use only Nginx directory indexing feature.

syntax: Autoindex_exact_size   on  |  off ;
configuration segment  
1 autoindex_exact_size on
http ,   server ,   location

Make sure to show the size of the file extra, in bytes, MB,GB, and so on. The default is to open the

syntax: Autoindex_localtime   on  |  off ;
configuration segment:  
1 autoindex_localtime off
http ,   server ,   location

Specifies whether to display the directory or the time of the file, which is not displayed by default

It can be found that the index function of Nginx is very single, far worse than the Apache. There are a lot of nginx enthusiasts can not see the past, developed a beautiful index plug-in, called Fancy Index. Please continue to follow the next section of the content nginx+fancy to achieve a beautiful index directory

Nginx Index Directory Configuration

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.