Nginx autoindex not working - 404 error
October 03, 2018 06:55AM
I have a server block which displays properly, unless I set it to autoindex. This results in a 404 not found error.

server block:

<code> server {
# listen 80;
# server_name $domain_name;
root /var/www/html/files;
# root /var/www/html;
# autoindex on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
Solved: Nginx autoindex not working - 404 error
October 05, 2018 06:20AM
I solved this by adding this to nginx.conf

location /files {
autoindex on;
autoindex_exact_size off;

And this is my server block

server {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

I am not sure what effect it had, but I also changed the root and sites available path from /var/www/html to /var/www
Re: Nginx autoindex not working - 404 error
February 08, 2019 08:50AM
Thanks, @archer72 friend for sharing your experience with us hope it really works for us also.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 102
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