nginx error: Nginx 403 error: directory index of “xxx” is forbidden

created at 10-17-2021 views: 1

After deploying the Nginx server, enter the IP address and port number, and return 403 Forbiddent.

Check the log error.log and find that the error message is:

nginx  error.log

directory index of xxx is forbidden

Among them, xxx is the root directory specified in /etc/nginx/nginx.conf.

Root cause of the error: When directly using the IP address and port number to access, you need to specify the index, if not specified, the error will occur.

At this time, you can add configuration in nginx/nginx.conf:

autoindex on; # Automatic index

autoindex on

In this way, when you visit again, all resource indexes will be listed.

Please log in to leave a comment.