fancyindex_case_sensitive
The `fancyindex_case_sensitive` directive determines whether directory listings are treated with case sensitivity when sorting filenames.
Description
The fancyindex_case_sensitive directive is part of the NGINX Fancy Index module, which enhances directory listings with styling and customizable options compared to the default autoindex module. When this directive is enabled (set to 'on'), NGINX will distinguish between files with names that differ only in case (e.g., 'File.txt' and 'file.txt') during sorting. If set to 'off', NGINX treats these filenames as identical, meaning that only one of them will appear in the directory listing, regardless of their casing.
The behavior of this directive is essential in environments where case sensitivity is crucial, such as on Unix-like systems, where 'file.txt' and 'File.txt' are treated as different files. By enabling case sensitivity, directory contents can be correctly represented to users, preserving the distinction in name casing. This directive can be set within the http, server, or location contexts, allowing granular control over directory listing behavior based on specific server or location configurations.
Config Example
location /files {
fancyindex on;
fancyindex_case_sensitive on;
}Remember that enabling case sensitivity may lead to confusion for users who expect filenames to be treated in a case-insensitive manner, especially on systems or environments that typically do not distinguish based on case.
Make sure to test the behavior of your directory listings both with and without the directive set to understand its impact on existing filenames.