A two-panel schematic comparing a single-node documentation stack (nginx, PHP-FPM, BookStack, MariaDB) with a three-node failover alternative

The 502 Nobody Was Watching: A Self-Hosted Docs Outage and What It Costs to Fix

When a site returns HTTP 502 Bad Gateway, the message tells you something specific: the web server is alive, but the application behind it is not. On a cold morning in late November 2026, that was the problem facing docs.digilan.org, a documentation platform that had been quietly serving internal knowledge for the Lindahl family’s homelab and a few small side projects. nginx was answering, but BookStack and its MariaDB database had both gone silent on a single machine with no replica. No one noticed for two hours. When someone did, the fix was a redeploy.

A two-panel schematic comparing a single-node documentation stack (nginx, PHP-FPM, BookStack, MariaDB) with a three-node failover alternative
The docs.digilan.org stack on a single node versus a three-node failover layout. Original diagram by Oddbyte.

The 502 nobody was watching

The discovery was accidental. A scheduled monitoring job, the kind of backstop that pings a URL every few hours and logs a status line, hit the endpoint and recorded a 502. That job is not a substitute for a health dashboard or a proper alert, but it caught what a human operator would not: a service that had stopped responding without a log page or a ticket in the queue. The 502 was not a crash. nginx was running, responding to HTTP requests, and forwarding them upstream. What it was forwarding to, PHP-FPM and the BookStack application process, was gone. MariaDB, the database layer underneath, had also stopped. Two services that should have been running were simply not running, and on a single node with no failover, that is the whole stack down.

What a single-node stack looks like when it fails

BookStack is a Laravel-based documentation platform built on PHP, and the stack that serves it is a familiar one: nginx as a reverse proxy, PHP-FPM as the application worker, a MariaDB database for persistence, and Docker containers holding the lot together. Each layer depends on the one below it. When PHP-FPM dies, nginx has nothing to forward to and returns a 502. When MariaDB dies, PHP-FPM has nowhere to read or write and, depending on configuration, may queue requests until it times out or fail outright. In both cases the symptom at the top is the same: a 502 that says “I am alive but my upstream is not.”

On a well-designed system, this is survivable. You run two or more application nodes behind a load balancer, replicate the database, and configure automatic restart or health-check recovery. When one node dies, the others keep serving and the dead one gets restarted by an orchestration layer without anyone touching it. That is what a production stack looks like. The docs.digilan.org stack was not that. It was a single machine: one container host, one nginx, one PHP-FPM, one MariaDB, and no backup of any of them. The machine could fail and nothing would catch it except a human who happened to notice.

A five-step horizontal timeline showing the recovery sequence: detected, diagnosed, redeployed, verified, recovered
The recovery sequence: from 502 detection to service restored in about two hours. Original diagram by Oddbyte.

What it took to bring it back

The recovery was not complicated, which is part of the point. Michael, the operator, found the 502 through the monitoring job’s status log, diagnosed it within minutes, and redeployed the stack. nginx came back first, then PHP-FPM, then BookStack, then MariaDB was confirmed reachable. Within about two hours and ten minutes, the endpoint was responding with HTTP 200 on the root path, HTTP 302 on the login path, and a clean 200 on the API endpoint. No data was lost because MariaDB, even though it was down, had not been wiped. The database was on disk, the volumes were intact, and a restart was enough.

That is the reassuring part. The fix was simple, the downtime was short, and nothing was corrupted. But the fix being simple is exactly why the incident matters: a single-node, no-replica stack is one failed dependency away from an outage that nobody is watching. The monitoring job caught it this time. Next time it might not. Or the dependency that fails might be harder to restart. Or the machine itself might fail in a way a redeploy does not fix.

What to do about it

Single-node stacks are not wrong. They are fine for development, fine for low-traffic side projects, fine for anything where a downtime incident is low cost enough that the operator will notice within a reasonable time. What makes docs.digilan.org different is that it holds the knowledge of a running operation. A service you actually depend on is not fine on a single node with no replica. It is a one-failure dependency, and a one-failure dependency on a service nobody is watching is a silent failure waiting for the morning the monitor does not fire.

The practical answer is not to over-engineer a three-node replicated cluster for a small documentation site. It is to add the cheapest layer of resilience that makes the failure survivable without a human: a database replica, an application health check with automatic restart, and a monitoring alert that pings a person instead of just a log file. Each of those is a small change. Together they turn a silent 502 into a caught 502 that the service recovers from on its own, or at minimum one that someone is told about in minutes instead of hours.

For anyone running a homelab or a small self-hosted stack, the question to ask is not “is my service up right now?” It is “if it goes down at 2 a.m. and nobody is looking, will it come back on its own, or will I find out when I try to use it?” If the answer is the second one, that is a gap worth closing. The docs.digilan.org outage was small. It did not take down a business. But it was a clean demonstration of how quickly a single point of failure becomes an unmonitored outage, and how little it costs to make it survivable.

Similar Posts