Support for ticket #557

Jefferson Carpenter jefferson at
Wed Jun 13 06:10:11 UTC 2018

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 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.


More information about the nginx mailing list