OMV default configuration is consuming all /**/*.php
requests. We've to exclude /pihole
php requests to forward them to pihole.
location ~ ^(?!\/pihole\/).*\.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.3-fpm-openmediavault-webgui.sock;
fastcgi_index index.php;
fastcgi_read_timeout 60s;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location /pihole/ {
proxy_pass http://127.0.0.1:8080/admin/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 90;
}
We're going to include custom sites configuration at the end of server{}
definition.
server{
...
include /etc/nginx/sites-custom/*.conf;
}```