fancyindex_hide_parent_dir

The `fancyindex_hide_parent_dir` directive controls the visibility of the parent directory link in directory listings generated by the Fancy Index module.

Syntaxfancyindex_hide_parent_dir on | off;
Defaultoff
Contexthttp, server, location
Argumentsflag

Description

The fancyindex_hide_parent_dir directive allows you to hide the optional link to the parent directory in custom directory listings generated by the Fancy Index module. When this directive is set to 'on', users will only see the contents of the current directory without a link to navigate upwards. This is particularly useful for enhancing security or simplifying the user experience in cases where directory traversal should be limited.

This directive operates within the context of http, server, and location, making it quite flexible in terms of application. Setting the directive to 'off' (which is the default behavior) allows the parent directory link to be displayed, promoting easier navigation through directory structures. However, when you enable it, the parent directory becomes invisible in the generated listings, ensuring users focus solely on the contents of the directory they are currently viewing.

To toggle this functionality, simply place the directive in your NGINX configuration file with the desired state, either 'on' or 'off'. The absence of a link to the parent directory can sometimes lead to confusion for users who expect traditional navigation patterns, so consider the user experience when deciding to hide it.

Config Example

location /files {
    fancyindex on;
    fancyindex_hide_parent_dir on;
}

Ensure users are aware of their current directory, as hiding the parent link can confuse navigation.

If your directory structure is deep, consider providing breadcrumbs or other navigation aids elsewhere on the page.

← Back to all directives