Nginx and Directory List Doesn't Work:

Nginx and Directory List Doesn't Work:

I have done just as in the tutorials but is simply not working:

server {
    location /abc {
        autoindex on;
        root          /home/user/abc/;
    }
}

It gives me 403 Forbidden, what I'm doing wrong? thanks; I've tried to use a "/" at the end, and also without but no changes.

When I go to myip/abc I hope to see some directory list but no. Even if I try to go to myip/abc/myfile.txt it doesnt work.

1 Answer

The problem is that by using the root instead of alias it will look in the wrong path. Also in the http the user was www-something and has had no permissions, thanks ubuntu, so now I had to change to my name and it worked:

  • Alias instead of root for the right path
  • Define the right user that has permissions to the folder you want

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.