← Back

Better static site errors

Improvement

Static sites now properly render 404 errors when deployed with Hatchbox. 🎉

Previously, accessing invalid URLs on a static site would return 502 errors. If Caddy couldn't find a matching file on disk, it would forward the request to the reverse proxy. Since static sites don't have a process to listen for HTTP requests, Caddy returns a 502 error since it didn't get a response from an upstream server.

We've adjusted our Caddy configuration to only include the reverse proxy when there is a process with the "web" role. Caddy now renders 404s because it doesn't have an upstream to check.

Error handling is also adjusted for static sites so to render 404.html if present.