-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default web port #85
Comments
have you tried changing the port with docker's NAT? e.g. I was under the impression this style of ad blocking required pi-hole be the default server in charge of port 80, this way when hitting a random ad domain over http (port 80) it gets the empty ad blocked page. |
I did, but that's only useful when using a bridged network connection, and when doing it like so it doesn't pickup de client ip's and it sees all the requests as coming from the docker container IP. Setting the serverip doesn't help. Maybe it's because i'm running it on a Synology NAS? Either way, mounting a different conf is working great. Didn't encounter any issues so far. |
so you're running --net host or another non bridged (NAT) style? Could you post your entire docker run command so I could play around with running in that style? I assume synology also runs it's web interface on port 80 so you're getting around that. |
I don't know the command, it's nice gui from Synology itself, but yes it's --net. The only reason I get around port 80 is that I adjusted the port in the lighttpd.conf file of the docker container to 8088. |
I'll see about adding the customization of port option after #84 is finished. |
Nice, thanks for the effort! |
I tried it before and it wasn't helping.. I rather not want to manually chance configs on the NAS. |
I've been looking into this as I also run pi-hole in docker on my DS916+. I've posted an article on how I solved the issue. I know you don't want to manually change configs, but unless Synology add support for this there is no other option available. |
When using your NAS also as a webserver this is not a great solution so I will stick to my current solution/workaround which is loading/mounting a custom lighttpd.conf file. This is still working flawless as far as I can judge. |
Buurman, would you mind explaining your full solution? I'm not sure how you can get pi-hole to dns your docker container if it's not running on port 80? |
I can give it a try this evening. Could you explain to me what shouldn't be working according to you? |
When pi-hole decides it needs to block an advert, the DNS server will return your configured server ip - in this case the IP address of the Synology. This means that when the webpage attempts to download the advert instead of asking the ad-server it asks the Synology which should return a blank page. However, because DSM is listening on port 80, instead of returning a black page it returns the Synology 404 page as the requested advert does not exist. This is especially problematic if you have Synology redirect HTTP to HTTPS as this then creates certificate warnings. I've not tried running a web server on the Synology so I don't know what this involves but it might mean that instead of attempting to load the advert from the DSM it is instead requesting from your own website that is running on port 80 and returning your websites 404 page? |
Aha I understand.. my 'solution' is a solution for the Admin page and not for the 'block page'. I performed a small test by trying to go to 'googleadservices.com' and instead I ended at my NAS root webpage.. which for my use is fine because it's a blank page that says 'Nope..' :-) None of my websites are in the rootfolder so the result is simular as the pi-hole block page. |
So an alternative could be to run your own website on the Synology with a blank root page? Is this something that is easy through the UI? edit: looks like you can't run a website on port 80 unless you give it a name which kinda defeats the purpose. |
I guess most people playing with Synology/Docker/Pi-Hole should be able to do this. But it depends on how they manage their websites. But essentialy it can be done in three steps:
Done.. |
Yes, that's what I'm playing with atm. Only just installed webstation. Last thing, instead of modifying the lighttpd.conf to allow access to admin, would it not be possible to add a name based reverse proxy that would forward all traffic to pihole.myhost.com -> pi-hole.docker ?? |
It would be possible, DSM6 can do this (Application Portal / Reverse proxy). |
Thanks for your help, I think setting up a blank root website is a good alternative to modifying the templates (who knows what this might break in future releases). I've decided to reverse proxy my pihole docker and just bookmark the host with /admin, this seems to work ok. |
We really don't try to break existing installations too often, it just looks a lot like that. :) |
I was talking more about breaking future Synology DSM releases (it's those templates i edited) rather than pi-hole itself. |
Eventually one of us Pi-hole developers will have to break down and pick up a Synology device so we can be of more assistance and help diginc out a little more with Docker on Synology. |
If you or diginc need volunteers for testing.. count me in. |
An alternative to buying a Synology is running Xpenology (can run inside VMWare I believe). |
Thanks, I'll take a look at that. |
I've got a Synology DS412+ as well as a Xpenology server (on a HP Gen8 Microserver).. both work great but be aware that a Xpenology server depends on community updates. |
@buurman Did you get the DHCP part working in Synology Docker, btw? |
Nope, don't need it so I didn't test it |
Checkout the latest |
I can confirm that the alpine_dev tag works for me on my synology running using host networking. I can change the http port so there is no clash. Oh and thanks! A small post on how I did this is here: |
Docker WEB_PORT variable does not work for some reason... It still listens for 80 port. Anybody know why? |
I changed this in the Debian image by modifying the lighttpd.conf file and forcing it to be readonly in the volume mount: docker ... -v ~/dev/pihole/lighttpd.conf:/etc/lighttpd/lighttpd.conf:ro ...` The file has this line: server.port = 37337 Then in nginx locally running on this machine I have this configuration file loaded: upstream pihole {
server 192.168.1.254:37337;
}
server {
listen 80;
server_name "~^.*$";
access_log off;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://pihole;
}
} Yes, it works. I would like to not have to override |
I was following @tonyklawrence's instructions for setting up on synology and can confirm WEB_PORT is no longer respected as well. 'latest' nor 'debian_dev' works, I did have it working with 'debian' however. declare -x TAG="debian_dev" Still gets 'port 80 in use' errrors. |
This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days. |
Could you change the default port to something else? Port 80 is a pain on my server, at the moment I just mount a custom lighttpd.conf (changed 80 to 8088) to /etc/lighttpd/lighttpd.conf and it works like a charm.
The reverse proxy solution isn't always easy and this is a quick solution, you could just load an editted conf file with the dockerfile.
The text was updated successfully, but these errors were encountered: