Hi there! A 403 Forbidden error on an Nginx server in CloudPanel usually means the server is denying access due to one of the following reasons:
1. No index file in the directory
By default, Nginx looks for files like index.html or index.php. If none are found, it doesn’t know what to show and returns a 403 error.
Solution:
Create a simple index.html file like this:
Code:
<!DOCTYPE html>
<html>
<head><title>Welcome</title></head>
<body><h1>Hello World!</h1></body>
</html>
Place it inside the directory you're trying to access.
2. autoindex is turned off
If there’s no index file and you want to list all files in the directory, you need to enable the autoindex setting.
How to do it:
Open the config file...