Reverse-Proxying services both inside and outside of Podman
Hey all, not-a-networks-guy here.
I've currently got an rpi set up running pihole natively (not in a container) for ad and website blocking reasons. (Using port 80, no TLS) I've used the pihole localdns feature to set an internal hostname for that ip (me.lan
).
On the same pi, I have podman "set up" to run FreshRSS, and I'm getting more and more annoyed about using the port # to access it. (me.lan:12345
) I'd like to set up a reverse proxy (probably Traefik) in a container to redirect internally, but considering that port 80 is taken (by pihole, outside of podman) I don't see a way to direct traffic from the pihole to Traefik.
I'd really rather not reconfigure the whole setup to use containers.... I'm lazy, and also prefer my dns resolver to have the least amount of overhead possible. Is configuring the router an option here, or is the only way to achieve what I'm looking for an overhaul of the pi and containers?
If I've missed any pertinent details, let me know and I'll update here.
While I don't run pihole, I do run traefik in the way that you describe, to proxy things both in docker and out of it.
Most https traffic uses port 443 by default. I don't bother configuring port 80 on traefik, I have it use DNS to manage automatic cert renewals with LetsEncrypt and only passthrough https traffic. I use DuckDNS for my external subdomain provider.
Here are my configuration snippets. You might want to check against Traefik's docs and update accordingly...I'm still running 2.X. I also use the yaml and labels for configs...not everybody prefers that method, but it works for me.
First, I use docker-compose, with a
.env
file to define variables and secrets. I define the proxy network externally usingdocker network create proxy
. Here's traefik with one of the docker-provided services, as well as HomeAssistant, using host networking, which to the proxy looks the same as being installed on the server outside of docker. Side note for HomeAssistant: Need to whitelist proxy's IP range, which is a bit of a PITA, especially with IPv6.compose.yml
Now for the meat and potatoes, my traefik config files. You'll notice in the
config.yml
That thehome
service points to a URL....this is how you can point to any service outside of docker, and you can point it to any valid URL. I had snipped out some other services for this which point to some static pages hosted outside my own network even.traefik.yml
config.yml