tutorial on installing fancy on hosts of LNMP environments

Source: Internet
Author: User
Tags file size local time

LNMP Environment

This is not much to say, there are currently 1.2 version of the LNMP specific please go directly to lnmp.org.
LNMP This one-button installation script, for my lazy people, part-time is too cool.

Fancy module

Ngx-fancyindex module is a nginx to beautify directory browsing (directory index) plug-ins.
It is not so much a plugin as a functional complement, because the Nginx's own directory indexing function is really powerless to spit the slot.

Installation of fancy Modules
in the Lnmp extract directory,

Mine is in the/root/lnmp1.2-full/include directory.
There is a upgrade_nginx.sh file

After finding it with the Nano editor,

Find nginx_modules_arguments= "" to replace with
Nginx_modules_arguments= "--add-module=/root/ngx-fancyindex"
The upgrade script is then executed and fancy is installed automatically.

Fancy directive uses:

Fancyindex
Syntax: *fancyindex* [*on* | *off*]
Default value: Fancyindex off
Configuration block: HTTP, server, location
Description: Turn on/off the directory indexing function

Fancyindex_css_href

Syntax: *fancyindex_css_href uri*
Default value: Fancyindex_css_href ""
Configuration block: HTTP, server, location
Description: External CSS path, this CSS will replace the existing CSS style. If you have CSS, you can make the index list more beautiful. We Ttlsa no web designer, so we can only use it with the ^ ^

Fancyindex_exact_size

Syntax: *fancyindex_exact_size* [*on* | *off*]
Default value: Fancyindex_exact_size on
Configuration block: HTTP, server, location
Description: Defines how the file size is displayed by default On,on: The file size uses an exact value, in bytes. Off: The unit is KB,MB,GB, and if it contains a decimal point, it will be rounded. For example, 1.9MB will be displayed as 2MB.

Fancyindex_footer

Syntax: *fancyindex_footer path*
Default value: Fancyindex_footer ""
Configuration block: HTTP, server, location
Description: Specifies which file is embedded at the bottom of the index page, and see the first picture in this article

Fancyindex_header

Syntax: *fancyindex_header path*
Default value: Fancyindex_header ""
Configuration block: HTTP, server, location
Description: Specifies which file is embedded in the header of the index page. Similar to Fancyindex_footer

Fancyindex_ignore

Syntax: *fancyindex_ignore string1 [string2 [... stringn]]*
Default value: No default.
Configuration block: HTTP, server, location
Description: Which files/directories are hidden, and if your nginx supports regular, you can use regular expressions to filter

For example, I want to hide the file or directory that the Dir starts with and the file Filea.txt, configured as follows:
Fancyindex_ignore "dir*" "Filea.txt"
The effect is as follows:

Contrast chart:

Fancyindex_localtime

Syntax: *fancyindex_localtime* [*on* | *off*]
Default value: Fancyindex_localtime off
Configuration block: HTTP, server, location
Description: Use local time to display the creation time of the file, default is off (GMT time)

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.