Invalid JSON response nginx docker

I’ve recently gotten pihole setup in a docker and use nginx to access it via “dockerhostip/pihole” and all is /was working well.

Today I decided to start playing with internal domain names for my lan so I added one to reference the docker host via the “Local DNS records” section. After testing that worked I went back to the admin page to add some more local domains, however I have discovered when ever I go to the “Local DNS records” page while accessing via domain name I get:

DataTables warning: table id=customDNSTable - Invalid JSON response. For more information about this error, please see

but if I revert back to accessing via IP it works fine.

The reason for this behaviour is because The web interface is only available when accessed by the hostname, pi.hole, or the IP address set in /etc/pihole/setupVars.conf.

You can set your hostname to pihole.home if you’d like.

You could also add it as another valid domain by following these instructions:

Add this to /etc/lighttpd/external.conf (or create it if it doesn’t exist):

setenv.add-environment = ( "VIRTUAL_HOST" => "pihole.home" )

Then restart lighttpd: sudo service lighttpd restart