So I was trying to setup directory listing on my server with nginx, I followed the instructions step-by-step but nothing worked out -- always showing either 403 or 404 errors while permissions are all set to 755...
When I enable autoindex on the root location it worked fine, but when I put it on the "dl/" location, it either shows a 404 when requesting /dl or 403 when requesting /dl/
After i followed @Bryce Larson's steps...403 is gone now only 404 is there...which is still not okay...
# pwd
/root/Downloads/dl
# ls -lha
total 12K
drwxr-xr-x 2 nginx root 4.0K Nov 25 20:01 .
drwxr-xr-x 4 root root 4.0K Nov 26 09:11 ..
-rwxr-xr-x 1 nginx root 26 Nov 25 20:01 blah.txt
Here's the nginx.conf
:
https://0bin.net/paste/he2oIb2OFou4G9Fd#v5qt5M7scM8jlSRkl9B+GepP+PoInAHrfZrJNJ7Ch9U
And yeah I've restarted nginx a hundred times just to make sure it takes the new config...so what's wrong now?
Otherwise, how would you configure the nginx server for this purpose?