Welcome! Log In Create A New Profile


Support for ticket #557

Jefferson Carpenter
June 13, 2018 02:12AM
Just want to show my support for allowing `autoindex` to include
dotfiles (ticket #557).

I am relatively new to nginx, and have been using it in increasingly
large and complex capacities recently. Specifically, more than once I
have now set up location blocks that basically enable directory
browsing. These location blocks generally look like this:

location ~ ^/git/?(.*)$ {
root /home/aoeu/git-webserver;
autoindex on;
try_files /$1 /$1/ 404;

(where that location block takes requests to the /git/ path on my domain
and allows it to be browsed as my local /home/aoeu/git-webserver
directory - generally I am interested in turning a particular path on my
domain into a file browse of a particular directory on my server).

Problem with this being, the `autoindex on` directive skips over hidden
(`.`) files when it generates directory listings, and cannot be
configured not to.

I'm still up in the air about how best to allow my sites to list and
statically serve files. More than simply displaying hidden (`.`) files,
I would like to be able to configure (maybe through a regular
expression) specifically what files are to be hidden, but given
`autoindex on` displaying all files (not hiding `.` files) this could
probably be done effectively enough by modifying the regular expression
that my location block matches paths against.

That is all. If anyone has ideas on plugins that could help me create
browsable directory listings *including* all dot files that would be
great - I did see
https://www.nginx.com/resources/wiki/modules/fancy_index/ but I don't
think that supports my full use case of mapping a specific path on my
domain onto a specific directory on my computer. I also saw some code
under ticket #557 that would help me to recompile nginx so that
`autoindex on` does not skip over dot files, and that's probably what
I'll do as the most direct way to meet my wants and needs in lieu of any
way to do it without compiling nginx locally.


nginx mailing list
Subject Author Posted

Support for ticket #557

Jefferson Carpenter June 13, 2018 02:12AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 78
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready