I'm trying to run a moodle application along with nginx but when I access the domain it returns 403. I've already changed the folder's permissions, the index.php file exists.
Log Nginx:
*306 directory index of "/var/www/html/moodle/" is forbidden
File config nginx:
server {
#access_log logs/yourwebsite.com-access_log;
#error_log logs/yourwebsite.com-error_log crit;
server_name estudar.cresceredu.com.br www.estudar.cresceredu.com.br;
index index.php index.html index.htm; # index defined to be served under directory
root /var/www/html/moodle/; # default directory where the files will be stored and served from
error_page 404 /index.html;
location = /index.html {
root /var/www/html;
internal;
}
location / {
#root /var/www/html/moodle;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
# moodle rewrite rules
# rewrite ^/(.*.php)(/)(.*)$ /$1?file=/$3 last;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
}