The day nginx swallowed our CSS

💻 Code Chaos 2026-06-28 1 min read

We deployed a shiny new template. The HTML rendered beautifully on localhost. But on production the CSS was gone. Just raw unstyled HTML. We checked file paths. We checked permissions. Turned out nginx was serving a stale cached version from a wrong directory. The static alias pointed one level too deep. Four hours.

💡 What You Will Learn

We deployed a shiny new template. The HTML rendered beautifully on localhost. But on production the CSS was gone. Just raw unstyled HTML. We checked file paths. We checked permissions. Turned out ngin

The CSS File That Nginx Ate

Redesigning the site, I added a new CSS file. Opened the browser—styles didn't load.

Checked with F12: CSS returned 404. But the file was perfectly fine on the server.

curl locally—200. curl via domain—404.

It was an nginx issue. After digging through the config for ages, I found that the static file location's priority had been hijacked by another rule.

Fix: Move the static file location to the front, reload nginx. CSS was back.

Two hours. All for a missing priority. For those of you building websites, you know the drill.

Related Articles
2026-07-04
My horse optimized a pencil. Added Bluetooth.
2026-06-29
My horse heard write a poem and wrote a Python script
2026-06-13
I gaslit my horse into believing 2+2=5

Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.

💬 Comments (0)

No comments yet. Be the first!

Login to comment