What this is about
"Is the site up?" sounds like a yes or no question. It is not. A program can be running while the page is broken. A page can load while the shop behind it fails. A site can work from inside your network and be gone for everyone else. This article explains how we check, what a real check looks at, and why we always check from outside.
Why it matters
Many outages are not loud. Nothing crashes. A setting is lost, a route points to an old place, a tunnel stops, and the home page still returns a 200 because a copy of it was served. Visitors notice before you do. A good check turns that quiet failure into a clear message.
How it works
A site is a path, not a process
For a visitor, a page load goes through several parts, as we saw in the first article of this series: the name lookup, the edge, the web server, the app and the database. A check that looks at only one part, such as "is the container running?", can pass while another part is down.
We learned this with a plain example. A container can be healthy and a page can return 200 and the site can still be wrong. In our base stack, one setting names which site the app should serve. When that setting was missing, the app served a placeholder site. Everything looked healthy. The comment in our setup file calls it the worst possible way to be wrong.
What our reboot check looks at
After a reboot of the host, we run a script. It does not stop at the process list. It checks, in order:
- That every expected container is running.
- That the tunnel program that connects us to Cloudflare is active. A healthy app behind a dead tunnel is still down to the public internet.
- That the public addresses return what they should, through their real domains. That includes a redirect that protects the operator panel.
- That the consent to analytics path works in a real browser, across three sites.
The result of one run was 37 of 37 checks passing. That number included each expected container, the tunnel, fourteen public routes through Cloudflare, and the browser check. The script prints the name of the failing check and exits with an error, so a half started system is never reported as green.
Why from outside
A check from inside the machine asks the app directly. It skips DNS, the tunnel and the web server. A check from outside walks the same path as a visitor. If your tunnel is stopped, only the outside check fails, and that failure is exactly the one that matters.
A simple rule: run at least one check from a different machine, using the public name, with a real fetch.
What a real check fetches
Not just the home page. A home page can be a cached copy. A good set has:
- The home page.
- A page that needs the database, such as a list of posts or a shop page.
- A page that must be blocked, which should return the blocked answer.
- A page that redirects, to check the redirect rule.
- A path that depends on a sidecar or a second program.
For each, check the status code and one word or title that proves it is the right page.
What the check costs
It takes longer than a quick look at the process list. It depends on the public edge and the browser tooling. It also makes maintenance work: the list of expected containers and routes has to change when the stack changes. We treat that list as an inventory, not as test code to throw away.
What counts and what does not
What counts:
- Expected containers running.
- Tunnel active.
- Public domains return the expected status.
- A fail count that tells you which boundary broke.
What does not count:
- Looking at the process list alone.
- A health address that is only reachable locally.
- A 200 from the home page as a stand in for every route.
A tiny check you can start with today
You do not need our script to begin. Pick the three pages that matter most on your site. Write a note with each address and one word that must appear on it, such as the shop's name or a button label. Once a day, from a machine that is not the server, fetch each address and look for the word. If any is missing, you have an alert with a name on it, and you did not have to wait for a visitor to tell you. Add more addresses over time, each time a surprise teaches you something.
Words you may not know
- Health check: a small test that says whether a system works.
- Container: a sealed box holding one program and what it needs.
- Tunnel: a connection from a service on the internet to a door on your machine.
- Route: a public address that the site answers.
- Status code: a number in the reply, such as 200 for ok or 404 for not found.
- Edge: the first machines a visitor reaches, before our app.
Try it
- Pick a site you run. List four addresses that must work. Fetch each from your phone on mobile data, not from your home network.
- In a terminal, run
curl -s -o /dev/null -w '%{http_code}\n' https://amarbaro.com/and then try one of our deeper pages. - Look at the sites we run at amarbaro.com/web and check one with the steps above.
Read next
- A Reboot Is Not a Health Check: the full record of the 37 checks.

Komentarze
Brak komentarzy.
Zaloguj się aby skomentować.