I'm trying to run Moode and PiHole on a Raspberry Pi (4 & 3B+) in my local network. Moode is running fine and I can access it via moode.local in my home network. Trying to access the pihole site via moode.local:8080 always results in *[error] 20680#20680: 46 directory index of "/var/www/html/" is forbidden, client: 2a0a:a549:e319:0:79a5:98fb:538:2c6f, server: _, request: "GET / HTTP/1.1", host: "moode.local:8080".
Can someone please tell me what I'm doing wrong?
default.conf
##
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
pihole.conf
server {
listen 8080 default_server;
listen [::]:8080 default_server;
root /var/www/html;
server_name _;
autoindex off;
error_page 404 /pihole/index.php;
index index.php index.html index.htm;
location / {
expires max;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param FQDN true;
# auth_basic "Restricted"; # For Basic Auth
# auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
}
location /*.js {
index index.js;
# auth_basic "Restricted"; # For Basic Auth
# auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
}
location /admin {
root /var/www/html;
index index.php index.html index.htm;
# auth_basic "Restricted"; # For Basic Auth
# auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
}
location ~ /\.ht {
deny all;
}
}
I set the permissions:
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html
sudo usermod -aG pihole www-data
I tried to set up a subdomain with similar results.