| title | Proxy | ||||
|---|---|---|---|---|---|
| section | Configuration | ||||
| order | 6 | ||||
| tags |
|
containers/proxy/ is an optional reverse proxy for a host: Caddy, as plain Quadlet files. It routes hostnames to the containers of the applications on that host, so the applications only need ExposeHostPort= and never clash over host ports.
Install it from the Proxy section of a host's settings in Pods. Pick how it gets certificates, and its ports:
| Certificates | For | Hostnames look like |
|---|---|---|
| Let's Encrypt | A public domain the internet reaches on port 80 or 443 | hello.example.com, ws.hello.example.com |
| Local certificate authority | Names such as .home.arpa, .lan or .test. Download the root certificate from the Proxy section, and trust it once on each device |
hello.home.arpa, ws.hello.home.arpa |
| Wildcard through DNS | A public domain on a host only your network reaches: one certificate for *.DOMAIN through your DNS provider (Cloudflare), whose API token is kept as a Podman secret on the host |
hello.DOMAIN, hello-ws.DOMAIN |
| Plain HTTP | Another proxy in front that handles HTTPS | as the front proxy routes them |
Pods installs containers/proxy from this repository as the application pods-proxy, keeps its settings, and writes ~/.config/pods-proxy/Caddyfile on the host with lpod pods-proxy mount, after caddy validate accepted it in the proxy's container, and the drop-in pods-proxy.container.d/pods-proxy.conf with the ports, the image, the DNS token's secret and the visits folder (~/.local/state/pods/visits by default, mounted writable at /var/log/pods-visits), where Caddy writes each application's visits file for suspend, without health checks. The token goes into the Podman secret pods-proxy-dns-token on the host, and never into Pods. The first time Pods needs a host's proxy settings, it takes in the ones lpod wrote, such as those of Pods 1.x and install.sh --proxy. Pods' drop-in sorts after lpod's lpod-proxy.conf of such a host, and resets the ports and the rest that file sets. The wildcard mode runs ghcr.io/foxws/pods-proxy:main, Caddy with the Cloudflare plugin (containers/runtimes/proxy/Containerfile, rebuilt every week); the others run caddy:2, and any of them can run your own image. Saving replaces a Caddyfile you wrote yourself, and keeps yours next to it as a backup, so keep sites of your own in ~/.config/pods-proxy/sites/*.Caddyfile. Rootless Podman can't publish ports below net.ipv4.ip_unprivileged_port_start (1024 by default), so Pods warns about 80 and 443 there: allow them, or use ports such as 28080 and 28443 behind the host's main proxy, which is also how each user on a shared host runs their own proxy. install.sh --proxy installs it too, with Let's Encrypt (or plain HTTP with --behind-proxy) on --proxy-ports, the first time only, and routes --host to Pods as a route of the application pods, which you edit on its page like any other.
Proxy defaults. Under Settings, Proxy, the owner sets what an environment's Proxy section starts from before its proxy is installed (the mode, email, ports, image), so installing it in another environment is one click. The domain there is the one Pods suggests hostnames under (hello.example.com, ws.hello.example.com) instead of home.arpa, except behind a wildcard site, whose own domain wins. Environments with a proxy keep their own settings, and the DNS token is never part of the defaults: it's asked for per environment, and only kept there.
Once the proxy is installed, Pods manages the routes: the install page asks for a hostname for each route an application's pods.yml names, and the Routes card on the application page adds, changes and removes them. Pods keeps them in its database, and a hostname can only go to one application of a host. Pods writes each application's routes into ~/.config/pods-proxy/sites/ on the host with lpod pods-proxy mount write, with a drop-in, pods-proxy.container.d/pods-routes-APP.conf, that joins the application's networks. Then it reloads Caddy (caddy reload in the proxy's container, which keeps open connections), or restarts the proxy first when it joins a new network. A stopped proxy stays stopped and reads them when it starts, and a change lpod didn't make isn't kept. The proxy mounts that folder read-only (:ro,z), so it can't change its own config, while lpod writes it on the host. Without a proxy, Pods keeps the routes, and installing the proxy delivers them all. Removing an application takes its routes off the proxy first, since a drop-in for a network that's gone would keep the proxy from starting.
The first time Pods needs a host's routes, it takes in the ones lpod already has, such as those of Pods 1.x and the one install.sh --host sets for Pods itself. After that, routes set with lpod APP routes set in a terminal don't show in Pods, and the next save from Pods replaces them.
Upstreams. A route's upstream is a name or address and a port:
| Upstream | For |
|---|---|
systemd-hello:8000 |
A container on one of the application's networks, which the proxy joins. The usual choice |
host.containers.internal:3000 |
A port on the proxy's own host, published on an address other than 127.0.0.1 |
192.168.1.20:8080 |
Another machine on your network |
The routes modal lists where the application's containers can be reached under Where APP listens, from the ports they publish and the networks they're on, and Pick fills one in. Pods can't see the ports of a container on the host network, so those show as unknown.
IPv6 addresses aren't supported. A container name only resolves on a network the proxy shares with it, so an application without a Network= (on Podman's default pasta network, or Network=host) is reached through the host. Use host.containers.internal for that, not the host's own IP: rootless Podman gives the proxy's network the host's address, so a connection to it stays inside the container's namespace and is refused. The proxy can't reach the host's 127.0.0.1 either, so a port published as PublishPort=127.0.0.1:3000:3000 needs another publish first, in a drop-in on the application's Files tab:
# adguardhome.container.d/proxy.local.conf
[Container]
# Publishes the web UI on the host's LAN address too, so the Pods proxy can reach it as host.containers.internal.
PublishPort=192.168.1.10:3000:3000Restart the application, then route to host.containers.internal:3000. Give the host a fixed address, or the drop-in breaks when it changes, or publish on every address instead (PublishPort=3001:3000, routed to host.containers.internal:3001), which needs another host port since 127.0.0.1:3000 is taken. Either way the port is reachable from your network without HTTPS, so block it in the host's firewall if the application's own login isn't enough. This is how to route AdGuard Home: on a bridge network, rootless Podman would show every DNS client as the gateway's address, so it stays on pasta.
Forwarded headers. Pods believes X-Forwarded-For, -Port and -Proto from private addresses only (TRUSTED_PROXIES in the pods-env secret picks others), and never X-Forwarded-Host, so a proxy in front has to pass the Host header on (Caddy does, nginx needs proxy_set_header Host $host;). Links in password reset mails use APP_URL, as passkeys do, so set it to the address you reach Pods at.
To install it by hand instead:
podman quadlet install --application=pods-proxy containers/proxy
echo '{"mode": "local", "http_port": 80, "https_port": 443}' | lpod proxy settings set --stdin --json
systemctl --user start pods-proxy