Software⏱️ 2 min read📅 2026-05-31

How to Fix: Nginx 403 error: directory index of [folder] is forbidden

403 error in Nginx due to forbidden directory index. Check site configurations and permissions.

Quick Answer: Verify site configurations, check file permissions, and ensure correct server blocks for each domain.

To resolve the Nginx 403 error, you need to identify and correct the issue with directory indexing. This occurs when Nginx attempts to serve a directory index for a specific folder, but the directory itself has forbidden access.

🛑 Root Causes of the Error

  • The problem lies in the way you've configured your Nginx server blocks. Each domain has its own server block, but they share the same directory structure.

🛠️ Step-by-Step Verified Fixes

Method 1: Correct Directory Permissions

  1. Step 1: Open your terminal and navigate to the /usr/share/nginx/mysite2.name/live/ directory.

Method 1: Correct Directory Permissions (continued)

  1. Step 2: Change the ownership of the directory to the Nginx user.

Method 1: Correct Directory Permissions (final)

  1. Step 3: Set the correct permissions for the directory using the command `chmod -R 755 /usr/share/nginx/mysite2.name/live/`.

💡 Conclusion

By correcting the directory permissions and ownership, you should be able to resolve the 403 error for your mysite2.name domain. Repeat these steps for the other two domains that are experiencing similar issues.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions