fancyindex_show_dotfiles
The `fancyindex_show_dotfiles` directive controls the visibility of dotfiles in directory listings generated by the Fancy Index module in NGINX.
Description
The fancyindex_show_dotfiles directive in the NGINX Fancy Index module allows users to specify whether dotfiles (files and directories that begin with a dot) should be displayed in generated directory listings. By default, dotfiles are hidden, which is a standard behavior for most web servers. When this directive is enabled, it modifies the listing behavior of the Fancy Index module to include these files and directories.
This directive can be applied in various contexts: http, server, and location, enabling flexibility in how directory listings are configured across different parts of the NGINX configuration. Setting the directive to 'on' will show dotfiles in the directory listing, potentially exposing configuration files or other sensitive items that could be a security risk if accessed by unauthorized users. Thus, it is crucial to use this directive with caution, particularly on public-facing servers.
The directive takes a flag as an argument where on enables the display of dotfiles, and off disables it (which is also the default setting). Users must ensure this directive is strategically placed to affect only the intended directory listings without compromising security.
Config Example
location /downloads {
fancyindex on;
fancyindex_show_dotfiles on;
}Enabling dotfiles may expose sensitive files like .htaccess if not properly secured.
Ensure that proper access controls are in place for directories exposed to the public.
Check the implications of showing dotfiles in regard to system security best practices.