Reverse proxy for the home lab: clean names, one HTTPS front door
A few services in, a home lab turns into a list of addresses nobody can remember: one dashboard on port 8096, another on 8123, a third on 9000, each reached by raw IP address and each answering over plain HTTP with a browser warning if it answers securely at all. A reverse proxy fixes the shape of the problem. One machine, or one container, becomes the front door. It owns a name for every service, terminates HTTPS, and passes each request to the right backend. Everything else in this guide is about doing that in the right order, because the most common mistake happens before any software is installed: exposing services to the internet that only ever needed to work inside the house.
Safety note: a reverse proxy concentrates access; it does not make a weak service strong. Any service you publish still needs its own login, its own updates, and a password worth the name. Treat the steps below as transport security, not as a substitute for securing the services behind the door.
Decide first: LAN-only, or public on purpose?
Most comparison guides start with software. Start with reach instead. There are three sensible postures for a home lab service, and the proxy configuration is different for each:
| Posture | Who can reach it | Certificate | Router change |
|---|---|---|---|
| LAN-only | Devices on the home network | Internal: Caddy issues from its own local CA for local names | None |
| LAN + VPN | Home network, plus your devices over a VPN tunnel | Same internal setup as LAN-only | None beyond the VPN itself |
| Public | Anyone on the internet | Publicly trusted, obtained automatically | Forward ports 80 and 443 to the proxy only |
The default worth choosing is the first or second row. Dashboards, hypervisor pages, and admin tools almost never need to be public, remote access to them is exactly the job a VPN already does well. Reserve the public row for a service you would be comfortable defending on its own: one that other people genuinely use, kept updated, with its own strong sign-in. Decide per service, write the decision down, and let the proxy enforce it, a hostname that only resolves inside your LAN cannot be reached from outside it, no matter what the proxy would allow.
Caddy vs Nginx Proxy Manager
Both tools terminate HTTPS and obtain certificates automatically. They differ in how a change is made, and that difference decides which one a beginner will still understand at midnight:
| Caddy | Nginx Proxy Manager | |
|---|---|---|
| Configuration | A short text file (the Caddyfile), one block per service | A web UI: proxy hosts, SSL tab, access lists |
| HTTPS | Automatic by default when Caddy knows the hostname; HTTP is redirected to HTTPS | Requested per proxy host; Force SSL option per host |
| Access control | Rules you write yourself in the config file | Built-in access lists: allow or deny by IP, optional username/password layer |
| Admin surface | No web admin UI to protect | An admin UI on port 81 that must itself be protected |
| Backups | The Caddyfile plus the persistent data directory holding certificates | The /data and /etc/letsencrypt volumes |
Choose Caddy when services change from the terminal anyway and a file that can be copied, diffed, and backed up sounds right. Choose Nginx Proxy Manager when a visual list of hosts and certificates is the difference between maintaining the setup and avoiding it. Either is a defensible answer; running both is not, one front door, one place to audit.
Path A: Caddy, step by step
- Give the proxy a fixed address. Reserve a static LAN
address for the machine or container running Caddy, and create the DNS
names you plan to use (for LAN-only, your router or local DNS maps names
like
service.hometo that address). - Write one site block per service. The documented
minimal form is a hostname line followed by the directive:
Replace the hostname and the backend address with your own. When Caddy knows the hostname, it serves the proxy over HTTPS automatically.photos.example.com reverse_proxy 192.168.1.40:8096 - For a public name, meet the public conditions first.
A publicly trusted certificate requires the domain's DNS records to point
at your server and ports 80 and 443 to be open to the public and directed
toward Caddy. For a LAN-only name, expect the local behaviour instead:
names like
localhostuse an auto-renewing self-signed certificate from Caddy's own CA, and a client that does not trust that root will show a security warning once, that prompt, and installing the root on your own devices, is the honest price of staying private. - Test the one-liner before committing to a file. The
quick-start command
caddy reverse-proxy --from example.com --to localhost:9000runs the same proxy immediately, which is a fast way to prove a backend answers before you formalise its block. - Close the side doors. On each backend service, remove any direct port publishing or firewall opening so the service answers only through the proxy (or only from the proxy's address). A proxy in front of a still-open backend is decoration, not a door.
Path B: Nginx Proxy Manager, step by step
- Install with the admin UI bound privately. A
hardened documented install keeps the admin interface on
127.0.0.1:81rather than published to the network, and keeps both the/dataand/etc/letsencryptvolumes so hosts and certificates survive container recreation. - Create the administrator properly. Current versions create the admin account on a first-run screen instead of shipping a default login; use a real email address, because Nginx Proxy Manager also uses it for Let's Encrypt.
- Add a proxy host. Under Proxy Hosts, add the domain
name, the forward hostname or IP, and the forward port of the backend.
When the backend is another container, put both on one shared Docker
network and forward to the container's service name and its internal
port, entering
localhostthere produces a 502, because to Nginx Proxy Manager, localhost means itself. - Request the certificate in the same flow. In the host's SSL tab, request a new Let's Encrypt certificate and enable Force SSL. Know which challenge you are using: HTTP-01 needs DNS pointing at the server and port 80 open; DNS-01, with a scoped DNS provider token, also covers wildcard names and works for names that are not publicly reachable.
- Use access lists deliberately. For any host that stays public but is really only for you, attach an access list that allows your own addresses and denies the rest, optionally with a username and password layer in front of the service's own login.
- Close the side doors, exactly as in the Caddy path: backends stop publishing their own ports.
What success looks like
Four checks, in order. First, the name works: browsing to the service's
hostname loads it over HTTPS with no warning on a device that should trust
the setup. Second, HTTP redirects: the plain http:// address
lands on the HTTPS version, which both paths do automatically once
certificates are in place. Third, the renewal story is real: the
certificate's storage lives in a persistent place (Caddy's data directory,
or the Nginx Proxy Manager volumes above), not in a throwaway container
layer. Fourth, the check almost every tutorial skips, the bypass test:
from another device, try the backend directly at its old
IP:port address. It should fail to answer for any service you
meant to put behind the door. If it answers, the setup is not finished,
whatever the proxy screen says.
Back up the front door
The proxy is now a dependency of every service, so its configuration belongs in the same backup routine as the services themselves. For Caddy that is the Caddyfile plus the data directory; automatic HTTPS depends on that data directory being writable and persistent, and losing it forces fresh issuance for every name at once. For Nginx Proxy Manager it is the two volumes named in its install step. A one-paragraph note recording which names are LAN-only and which are public, the decision table from the start of this guide, is the third backup item, and the one future-you will thank present-you for when a name stops resolving and the question is whether it ever should have.
FAQ
Do I need a domain I own for LAN-only names? No. A private suffix resolved by your own DNS works, at the cost of trusting Caddy's local CA on your devices. Owning a real domain mainly buys publicly trusted certificates and names that also work in the public posture.
Can the proxy make an insecure service safe to publish? No. It adds HTTPS and one auditable entry point. A service with no login, or one that is months behind on updates, stays unpublished, that decision is the first table in this guide, not a proxy feature.
Why a 502 from Nginx Proxy Manager? Most often the
forward host is wrong for a containerised backend: use the service name on
the shared Docker network and the container's internal port, not
localhost and not the host's mapped port.