Nginx_ Open Directory file list feature

Source: Internet
Author: User

Ngx_http_autoindex_module This module is used to automatically generate a list of directories, Ngx_http_autoindex_module only make requests when the Ngx_http_index_module module does not find an index file.

Nginx default is not allowed to list the entire directory.

Open Directory list:
Open the nginx.conf file and join in the Location server or HTTP segment
AutoIndex on;

For example:

HTTP {
Include Mime.types;
Default_type Application/octet-stream;

AutoIndex on;//Auto Display directory
Autoindex_exact_size off;//user-friendly way to display file size otherwise, it is displayed in byte
Autoindex_localtime on;//is displayed by server time, otherwise it is displayed in GMT time

Server_names_hash_bucket_size 128;
Client_header_buffer_size 32k;
Large_client_header_buffers 4 32k;
Client_max_body_size 8m;
Limit_zone one $binary _remote_addr 32k;

Sendfile on;
Tcp_nopush on;

Keepalive_timeout 60;
Tcp_nodelay on;

gzip on;
Gzip_min_length 1k;
Gzip_buffers 4 16k;
Gzip_http_version 1.0;
Gzip_comp_level 2;
Gzip_types text/plain application/x-javascript text/css application/xml;
Gzip_vary on;

Log_format wwwlogs ' $remote _addr-$remote _user [$time _local] $request $status $body _bytes_sent $http _referer $http _user _agent $http _x_forwarded_for ';
#include default.conf;
Include vhost/*.conf;
}


autoindex_exact_size off; The
default is on to show the exact size of the file, in bytes.
When off, displays the approximate size of the file, in kilobytes or MB or GB
The
default is off, and the file time displayed is GMT time.
  When on, displays the file time as the file's server time

Configure the Nginx directory list method detailed reference: Http://wiki.nginx.org/NginxChsHttpAutoindexModule

If you want the directory list to support Header,footer, you can install the three-party plug-in:   http://wiki.nginx.org/ Nginxngxfancyindex

Nginx_ Open Directory file list feature

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.