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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like