How can I set up custom addresses and routing for my LAN reddit / selfhosted ---------------------------------------------------------------------- SecretGood5595 · 2023-10-31 21:12 Hi, New to all this, just got a few services I'm running on a raspberry pi to get started, but I'd already like to start using an address like pihole.home.lan to access a service instead of memorizing the ip and port. Since everything is on the pi the services are have individual ports, which I think complicates things. Trying to do everything in docker too, mostly because it seems to make it easier to remove something if it gets botched. I've done a little googling to figure this out, seems like the solution is a combination of pihole to catch requests then send them to nginx to route them to individual ports. I found a guide which looks like it should do exactly this [https://github.com/pi- hole/docker-pi-hole/blob/master/examples/docker-compose-nginx- proxy.yml](https://github.com/pi-hole/docker-pi- hole/blob/master/examples/docker-compose-nginx-proxy.yml) but it the services aren't connecting to each other right. If anyone has another guide to accomplish something similar or could answer some questions I'd appreciate it! ---------------------------------------------------------------------- hdddanbrown · 2023-10-31 22:51 Tousands of guides exist about setting up a reverse proxy like Traefik, Caddy, nginx, Nginx Proxy Manager and so many more. And the same for a local DNS like Pihole or Adguard Home etc. You can simply search this sub, this gets asked atleast oncs per week. ---------------------------------------------------------------------- CornFlakes1991 · 2023-10-31 22:59 Are you using Portainer? Eitherway, I would recommend to skip the docker compose you linked and starting by creating a macvlan. After that, I would set up PiHole which uses the macvlan (so it has its dedicated ip - Makes things either down the line) after that, create a nginx-proxy-manager container but this is running on the normal bridge network. But first, create the macvlan and setup PiHole accordingly. By the way, if PiHole is set as your DNS server (which you should do otherwise it defeats the purpose) you can access pihole with [http://pi.hole](http://pi.hole) ---------------------------------------------------------------------- hdddanbrown · 2023-10-31 23:03 Why confuse them with macvlan? Keep it simple. Besides if they want to proxy the Pihole webinterface then the proxy container cannot easily reach the macvlan Pihole container. ---------------------------------------------------------------------- CornFlakes1991 · 2023-10-31 23:20 Well, then I have to have some magic running in the background as its working just fine for me for years now and I can easily reach containers which use the macvlan ---------------------------------------------------------------------- hdddanbrown · 2023-10-31 23:23 Then why not provide your exact setup to them instead of confusing them even more? ---------------------------------------------------------------------- CornFlakes1991 · 2023-10-31 23:28 Well, I did. I said, he should create a macvlan after that create the Pihole container and let that container join the macvlan. Then setting up a nginx-proxy-manager container is nothing confusing As you already stated, there are "Tousands of guides exist about setting up a reverse proxy like Traefik, Caddy, nginx, Nginx Proxy Manager and so many more. And the same for a local DNS like Pihole or Adguard Home etc." ---------------------------------------------------------------------- SecretGood5595 · 2023-10-31 23:37 I am using portainer, such a nice way of keeping it all organized. Debating exactly what to keep native and what to put in docker, and the best ways of storing the starting information. The config files seem like the easiest way to keep things stored in a place I can locate, but portainer does have the app template stuff where it can all be manually filled in. About to wipe it and start fresh, planning on just doing everything except wireguard in docker to keep it consistent. So the pihole is set as my DNS, and it is blocking requests, caching correctly, but pi.hole is not redirecting. It "refuses to connect". Maybe something is just borked with my current install, going to start fresh and test thoroughly as I put each piece in place. So to get this working, I have the pihole as my DNS, and I have those entries which will redirect say "plex.home.lan" to my pi's IP address, correct? Then reverse proxy/nginx takes those redirections and sends them off their specific services. Is that correct? And for the nginx redirects, if I am running both the pihole and nginx as containers, do I use their "internal" IP that portainer shows? ---------------------------------------------------------------------- CornFlakes1991 · 2023-10-31 23:58 >So to get this working, I have the pihole as my DNS, and I have those entries which will redirect say "plex.home.lan" to my pi's IP address, correct? Then reverse proxy/nginx takes those redirections and sends them off their specific services. Is that correct? Correct, you need to set the domain you want in PiHole under Local DNS Settings and then in nginx you need to the same basically by adding a proxy host The IP you need to use is the one of the machine its running on. In my case 192.168.1.43 In PiHole you only need to use the IP without the port. In the proxy manager you need to provide the port the service is running on