Self-Contained Environment

What I see around the web quite frequently, is that people want to multi-task their pi's, and run other webservices alongside.

What I suggest is that like many applications, (ie. plex, sonarr, couchpotato, etc...), pihole should have a contained webui.

By default it would run on port 80, but would have a setting to change that port from the webui or the initial install. Having a setting locked in the config file would be nice as it would stick between upgrades. (I run lighttpd on an alternate port, but upgrading sometimes has changed it back to port 80)

I think this would solve problems for people that choose to run nginx or apache on port 80, and just reverse proxy.

Speaking of reverse proxy, it would also be nice to be able to set a base-url/root-url. that would allow people to easily reverse proxy the webui without being stuck with /admin or a bad nginx rewrite.

Another benefit of doing this would be making parts of the pihole setup not as easily "tamperable". I think people break things on accident when they play with other webservices.

If you are running it off port 80, you should know the implications - the blocking page cannot be shown any longer. Also - as the DNS entries will now point to the Raspberry itself - the content of the page that is then running on port 80 (like a web blog) can be shown in various places (also inpage) where ads are to be loaded.

Fortunately my landing page is Organizr, and I changed the "loading image" to my deathbybandaid avatar. Typically that's all that appears, and I'm comfortable with that.

By default it would run on port 80, but would have a setting to change that port from the webui or the initial install. Having a setting locked in the config file would be nice as it would stick between upgrades. (I run lighttpd on an alternate port, but upgrading sometimes has changed it back to port 80)

If you are running it off port 80, you should know the implications - the blocking page cannot be shown any longer. Also - as the DNS entries will now point to the Raspberry itself - the content of the page that is then running on port 80 (like a web blog) can be shown in various places (also inpage) where ads are to be loaded.

If we could set where the blocked site is, for example a cname (pihole.<<>yourdomain>.com) instead of an a record which holds the pihole ip.

Would this solve the problem?

BTW how does pihole handle clients through the reverse proxy?

1 Like

Sounds like could be a solution.

  • Now:
    lighttpd is asked to show page for "ad.com":
    [ad.com] --(A record)--> [Pi-Hole IP] --(lighttpd)--> [show 404-error-handler]

  • If use CNAME:
    lighttpd is asked to show page for "pi.hole" instead of "ad.com":
    [ad.com] --(CNAME record)--> [pi.hole] --(A record)--> [Pi-Hole IP] --(lighttpd)--> [show vhost entry]

I can test CNAME bit but not now as I am in middle of things.

1 Like

Nope, doesnt work.
I created below CNAME:

pi.hole.dehakkelaar.nl --> pi.hole

And did:

pi@noads:~ $ curl -I http://pi.hole.dehakkelaar.nl
HTTP/1.1 200 OK
X-Pi-hole: A black hole for Internet advertisements.
Content-type: text/html; charset=UTF-8
Date: Wed, 10 May 2017 23:46:57 GMT
Server: lighttpd/1.4.35

And:

pi@noads:~ $ sudo tail -1 /var/log/lighttpd/access.log
1494460017|pi.hole.dehakkelaar.nl|HEAD / HTTP/1.1|200|0

This looks like dead end.

EDIT funny now this working for everyone :smiling_imp:
http://pi.hole.dehakkelaar.nl/admin/

And even on a blacklisted domain :joy:

Ps.Its obvious from above, this forum doesnt resolve via Pi-Hole :tongue: