fancyindex_ignore

The `fancyindex_ignore` directive specifies files or directories to be excluded from the Fancy Index listings.

Syntaxfancyindex_ignore pattern;
Defaultnone
Contexthttp, server, location
Arguments1+

Description

The fancyindex_ignore directive in the NGINX Fancy Index module allows users to define specific files or directories that should be ignored in the generated listings. This can be useful for excluding temporary files, backup files, or any other items that do not need to be displayed in the public directory index. The directive accepts one or more pattern arguments, enabling flexible exclusion criteria using wildcard matches. When a file or directory name matches any of the provided patterns, it will not appear in the Fancy Index output.

The syntax of the directive is straightforward, allowing users to specify multiple patterns by separating them with spaces. The pattern matching supports standard Unix-style wildcards such as *, which matches any string of characters, and ?, which matches any single character. However, it's important to note that proper testing of the patterns is essential to avoid unintended exclusions of important files.

One common use case is to ignore files with specific extensions, such as .tmp, .bak, or any hidden files that begin with a dot (.) by using patterns like *.tmp or .*. This ensures that the directory listings remain clean and user-friendly, focusing on the relevant files while hiding the clutter of temporary or non-essential data.

Config Example

location /files {
    fancy_index on;
    fancyindex_ignore .tmp .bak .DS_Store;
}

Ensure that patterns are correctly specified; a typo may lead to unintended inclusions or exclusions.

Be cautious with wildcards; for example, *backup* would exclude any file name containing the word 'backup'.

If using multiple patterns, ensure proper spacing and syntax to avoid configuration errors.

← Back to all directives