Your CloudFront Site Returns 403 for Missing Pages, Not 404

A static site on S3 behind CloudFront with Origin Access Control returns 403 Forbidden for every URL that does not exist, not 404 Not Found. The cause is the OAC bucket policy, and the fix is two entries in the distribution config.

September 27, 2026 · 4 min · Conselara Labs

Deploying a Hugo Site to S3 + CloudFront: What Actually Bit Us

We migrated a Hugo static site from a self-hosted nginx container on a local server to S3 + CloudFront. The motivation was simple: a static site has no business running on a server we have to patch. The migration took a few hours and involved four gotchas that aren’t obvious from the AWS documentation. This is a record of what we did and what tripped us up. The setup Hugo static site (PaperMod theme) S3 bucket with all public access blocked: Origin Access Control (OAC) only CloudFront distribution with ACM SSL cert Cloudflare DNS, gray cloud (DNS-only) Gitea self-hosted repo with a webhook-triggered deploy container on-prem The deploy flow on push: Gitea fires a webhook → container on saturn pulls the repo, runs hugo --minify, syncs to S3, invalidates CloudFront. ...

May 14, 2026 · 4 min · Conselara Labs