Hosting My Own Site Images, Without Exposing My Home Server

Updated 2026-11-30. The first version of this post put Immich on a public subdomain and had Caddy serve images straight off disk. Neither survived. Immich is now Tailscale-only, images go through a small nginx container, and a new subdomain exposes exactly one webhook. See What changed.

I got Immich running on the OptiPlex under my desk. The next question was what, if anything, should be reachable from the public internet.

The answer turned out to be: as little as possible.

  • img.jaxleedigital.com: static image CDN for posts on this site
  • hooks.jaxleedigital.com: one webhook path, for this site’s contact form

Immich isn’t on the list. More on that below.

The tool in front of both: Caddy. It’s a reverse proxy that handles TLS certificates automatically. The whole config fits on one screen.


Why Caddy over Nginx

Nginx works. I’ve used it for years. But the cert management story is annoying: certbot, cron jobs, renewal hooks. Caddy handles all of that internally. The config is also dramatically simpler.

Nginx + certbot for a single reverse proxy:

server {
    listen 80;
    server_name img.jaxleedigital.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name img.jaxleedigital.com;

    ssl_certificate /etc/letsencrypt/live/img.jaxleedigital.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/img.jaxleedigital.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:8097;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Plus a certbot install, an initial cert run, a renewal timer, and reload hooks.

The Caddy equivalent:

img.jaxleedigital.com {
    reverse_proxy 127.0.0.1:8097
}

Caddy gets and renews the cert itself. Done.


The full Caddyfile

{
	acme_dns cloudflare {env.CLOUDFLARE_DNS_TOKEN}
}

# Static images for jaxleedigital.com posts
img.jaxleedigital.com {
	reverse_proxy 127.0.0.1:8097
}

# One webhook for the contact form. Everything else is a 404.
hooks.jaxleedigital.com {
	@contact {
		path /webhook/contact
		method POST OPTIONS
	}
	handle @contact {
		request_body {
			max_size 64KB
		}
		reverse_proxy 127.0.0.1:5678
	}
	handle {
		respond 404
	}
}

Three pieces:

  • The global block gets certificates through Cloudflare’s DNS API (the DNS-01 challenge) instead of answering an HTTP challenge on port 80. Caddy needs a scoped Cloudflare API token, read from the environment.
  • img forwards to an nginx container listening only on localhost. That container mounts one folder, /mnt/media/photos/posts, read-only. It serves image files and nothing else.
  • hooks fronts n8n, the workflow engine that handles the contact form. n8n’s editor and API stay on my private network. Caddy forwards exactly one method and path, caps the body at 64 KB, and returns 404 for everything else. If someone finds the subdomain, the only thing they can do is submit the form, and the workflow checks that too.

Why Immich isn’t public

The first version of this setup had photos.jaxleedigital.com pointing at Immich. I took it down.

Immich is a logged-in app holding my entire photo library. A public hostname means its login page and API face the internet forever, and I’m trusting every future Immich release to get auth right. Cloudflare’s free plan also caps request bodies at 100 MB, which quietly breaks video backups from the phone.

Tailscale solves both. The phone reaches Immich from anywhere over the tailnet, uploads aren’t capped, and nothing about Immich is public. The tradeoff: share links don’t work for people outside my tailnet. I can live with that.

The rule I ended up with: if only I use it, it lives on Tailscale. If the public needs it, it gets the smallest possible surface behind Caddy.


The setup (Fedora)

sudo dnf install -y caddy
sudo caddy validate --config /etc/caddy/Caddyfile
sudo systemctl enable --now caddy
sudo systemctl reload caddy   # after config changes

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Cloudflare in front

Both subdomains are A records pointing at the house, with Cloudflare’s proxy on (orange cloud). SSL/TLS mode is Full: Cloudflare encrypts to Caddy, and Caddy has its own Let’s Encrypt cert.

Client
  └── Cloudflare (TLS, cache, DDoS)
        └── Home IP:443
              └── Caddy
                    ├── img.*   → 127.0.0.1:8097 (nginx, /photos/posts only)
                    └── hooks.* → 127.0.0.1:5678 (n8n, one webhook path)

Phone, anywhere
  └── Tailscale → Immich (tailnet only)

One thing Cloudflare taught me: every proxied record pointing at the same IP shares one secret. For weeks img was set to DNS-only, which published the home IP and made proxying everything else pointless. Cloudflare’s dashboard flags this now. Proxy all of them or none.

The router forwards ports 443 and 80 to the OptiPlex. Worth writing down somewhere, because a router reset wipes them and everything public goes dark with a Cloudflare 522.


Image organization on disk

Site images live at /mnt/media/photos/posts/<slug>/filename.jpg. A post references one like this:

![Alt text](https://img.jaxleedigital.com/photos/posts/green-turtle-cay/2026-01.jpg)

New posts get a folder. Images go in. No build step.


What changed (2026-11-30)

  • Caddy no longer serves files off disk. The original config used root * /mnt/media/photos with file_server. On Fedora with SELinux enforcing, those files carry the container_file_t label because they’re mounted into containers, and Caddy isn’t allowed to read them. Images never actually loaded.
  • That was lucky. The same root also contained Immich’s library. If SELinux hadn’t blocked it, my whole library would have been served to anyone who guessed a path. The nginx container now mounts only the posts folder, so the library isn’t even visible to the thing serving the public.
  • photos.jaxleedigital.com is gone. Immich is Tailscale-only.
  • hooks.jaxleedigital.com is new. One webhook path for the contact form, nothing else.
  • Certificates use DNS-01 through the Cloudflare API instead of an HTTP challenge.

Result

img.jaxleedigital.com: static images off the 18 TB drive, cached by Cloudflare.

hooks.jaxleedigital.com: one form endpoint.

Immich: private, reachable from anywhere I am, invisible to everyone else.

Still one screen of config. Still no renewal cron jobs.