Below is my Nginx configuration file. Whenever I try to install flarum and visit my url, I get 403 Forbidden. What do I miss in this configuration that the error log shows this:
[error] 39065#39065: *2 directory index of "/var/www/example.com/html/" is forbidden, client: IP, server: example.com, request: "GET / HTTP/1.1", host: "example.com"
?
Nginx configuration file for Flarum is:
server {
listen 80;
listen [::]:80;
root /var/www/example.com/html/;
index index.php index.html index.htm;
server_name example.com www.example.com;
#add php suport (I have php8.1 installed and running)
location ~* \.php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
}
include /var/www/example.com/html/.nginx.conf;
}
P.S. I tested the folder's permissions using Hello World
in index.html
and worked perfectly. But I cannot have flarum installed because of the 403 error.