Docker, Data Loss, and Cloudflare: A Dev’s Daily Log

post-title-1743233677642

1. All blog posts disappeared

After resetting a Docker volume, all blog posts were gone.
The backup was stored inside the container, so it vanished along with the volume.
From now on, the backup should be stored outside the container to avoid this.

2. Cloudflare ignored my Nginx settings

Despite configuring various security headers (CSP, HSTS, etc.) in Nginx,
they weren’t showing up in the actual HTTP responses.
Turns out, Cloudflare overrides origin server headers.
When using Cloudflare, security headers must be configured directly within its dashboard.

3. Using a CDN is not the end

I used to think that enabling a CDN was the final step, but it’s not that simple.
To properly use Cloudflare, you need to understand how it works under the hood.
Otherwise, instead of improved performance or security, you might end up with unexpected issues.