Linux – way to disable symbolic links for nginx auto-indexed directory

linuxnginxSecuritysymbolic-link

I would like to configure nginx to list and serve bulk files from a select directory (autoindex on option). However I worry that if a symbolic link will be accidentally placed in such a directory, all files in the filesystem may become externally exposed (for example by a symbolic link to /).

Is there a way to avoid this?

Best Answer

Use the disable_symlinks directive:

disable_symlinks on
Related Topic