fancyindex_directories_first
The `fancyindex_directories_first` directive specifies whether directory entries should appear before file entries in directory listings.
Description
The fancyindex_directories_first directive is part of the NGINX Fancy Index module, which provides an enhanced directory listing feature compared to the standard autoindex module. When enabled, this directive alters the sorting of directory listings such that all directory entries are displayed before any file entries, facilitating easier navigation in directories with mixed content (i.e., both files and folders). The behavior is activated by setting the argument to on. Conversely, by setting it to off, the default behavior, which may interleave files and directories based on their names, will be retained.
This directive can be applied within the contexts of http, server, or location, allowing for tailored configurations at various scopes of the NGINX configuration. Implementing this directive can enhance the usability of directory listings, especially for users who prefer to navigate through directories before viewing files when dealing with a substantial number of entries. It's important to note that the directive is not relevant if directory listings are not being generated by the module, as the Fancy Index module needs to be active for this directive to take effect.
Config Example
location /files {
fancyindex on;
fancyindex_directories_first on;
}Ensure the Fancy Index module is properly installed and enabled; this directive has no effect if the module is not in use.
Be cautious when nested directory listings are present; changing sort order might affect user experience.