Journal
Personal
27 Nov 2025#ops#web#flutter#supabase 1 min read

Fifty minutes after the first Coolify deploy

Five fixes for Flutter web behind nginx, each a reusable gotcha.

FromBobinarca: PCB Component Inventory
Update, Sep 2026

The app later moved to the k3s cluster and was retired in September 2026. The nginx rule below still applies to any single-page app.

First self-hosted deploy on Coolify, then five fixes in fifty minutes: a deprecated renderer flag in the Dockerfile, stale HTML served from cache after a new build, nginx location blocks in the wrong order, row-level-security errors leaking raw into the UI.

The hashed assets can be cached forever; the file that names them cannot, or every deploy looks broken for exactly one reload. The exact-match block has to come first:

NGINX
location = /index.html {
    add_header Cache-Control "no-cache, no-store, must-revalidate";
}

location ~* \.(js|css|png|svg|woff2)$ {
    expires 1y;
    add_header Cache-Control "public, immutable";
}
Takeaway

Never cache the HTML entry point of a single-page app.