Skip to content
Go back

Why Caddy proxy sometimes causes a zero-byte file to download

| Last edited: Immutable-ish

As I was finalizing the deployment of my new personal website using Caddy and Docker, I run across a situation where I would view the website and after a brief pause, Safari would download a zero-byte file using the domain as the name of the file.

For example, this is in my Downloads directory:

hiro@sophon:~|  ls -ltrh ~/Downloads| tail -1
-rw-r--r--@   1 hiro  staff     0B Jul 30 16:05 test.andrewhoog.com

I saw this a few times during development and I keep forgetting the cause and solution. Apparently if there isn’t a service running at the ip and port that Caddy expects, it will trigger this behavior.

I’m not sure if there’s a more elegant way to handle this in Caddy or there could be other things that causes, but if it happens to you, definitely make sure the downstream service is running and responding.


Share this post on:

Previous Post
Claude Code committed directly to main
Next Post
How to convert PNGs to WebP on macOS