@DanSchaper ,
I posted below to comfort, Discourse derailed (cloudflare error) and my post was gone ?
Luckely my editor kept a copy
I dont have a solution for you because Pi-Hole was designed to run on top of dnsmasq and lighttpd.
But you dont need the web GUI if your only interested in getting the ads to be blocked.
Most of the magic is done by dnsmasq resolving known blacklisted ad domain names to that of the Pi-Hole IP address eg:
C:\>nslookup doubleclick.com noads.dehakkelaar.nl
Server: noads.dehakkelaar.nl
Address: 10.0.0.8
Name: doubleclick.com
Address: 10.0.0.8
Instead of resolving to the actual IP address(es) for the ad:
C:\>nslookup doubleclick.com 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
Name: doubleclick.com
Addresses: 172.217.17.110, 172.217.17.110, 172.217.17.110
So if you can get this bit to work, you are done for 90%.
The other part involves Pi-Hole to return a blank page instead of the ad via its own lighttpd daemon:
$ tree /var/www/html/pihole/
/var/www/html/pihole/
+-- blockingpage.css
+-- index.js
+-- index.php
For that to work, lighttpd got these configuration options:
server.document-root = "/var/www/html"
server.error-handler-404 = "pihole/index.php"
So if you want nginx to do the same, you got to find the 404 error handler for nginx and configure yourself.
But Pi-Hole also depends an a few cron jobs to keep the blacklists updated and do some maintenance:
$ grep -v '^#' /etc/cron.d/pihole
59 1 * * 7 root PATH="$PATH:/usr/local/bin/" pihole updateGravity
00 00 * * * root PATH="$PATH:/usr/local/bin/" pihole flush
@reboot root /usr/sbin/logrotate /etc/pihole/logrotate
Another alternative is to have both web daemons running and have them listen to different IP addresses so they wont conflict (below is for Raspbian/Debian/Ubuntu):
I know I dont have a ready solution but at least you have a bit of an idea whats going on under the hood.