homelabnetwork , 4 min read

Three outages that depended on where the request started

My uptime monitor stayed green for two days while my gateway was unreachable from outside. Its replacement saw everything as down. A month later, every model call from Vietnam failed at OpenRouter's Hong Kong edge, and a 60-line relay in Singapore fixed it.

For most of this year an Uptime Kuma container on the home cluster watched my services and sent alerts to Telegram. It pinged the router, the NAS, the containers, and the public hostnames of the things I expose to the internet. It was green almost all the time, which I took as good news.

Green from the inside

On October 24 the public DNS record for my model gateway went stale. It pointed at an old IP. Every request to the gateway from outside the house failed.

Kuma stayed green for two days. It ran inside the home network, where the gateway's hostname resolved to a LAN address through a local DNS rewrite. From where Kuma sat, the gateway answered every check. The monitor was asking the right question from the one place where the answer was always yes.

Red from the outside

On October 26 at 12:32 I replaced it with a Cloudflare Worker on the free plan. A cron trigger runs it every minute. It makes HTTPS requests to the public hostnames, the same way anyone outside would. It also has a check of a different kind: it asks Cloudflare's DNS-over-HTTPS resolver for the home's public records and alerts if they don't all hold the same IP. That's the exact failure Kuma missed. Alerts go to Telegram once when a check goes down and once when it recovers, with how long it was down.

The first deploy showed everything at home as down. The reverse proxy at home has a geo block that only lets in requests from Vietnam, and Cloudflare Workers send their requests from wherever Cloudflare decides, which is not Vietnam. The new monitor was outside, which was the point, and outside was blocked. One customer box behind a Vietnam-only nginx had the same problem.

The fix for my own hosts was a secret header that the proxy lets through for plain GET requests, sent only to hosts I own. The customer box came off the list, since I don't control its nginx. It went in at 12:44, twelve minutes after the first commit. By 13:32 the bot also answered /uptime with seven-day uptime per service, with buttons for today, 7 and 30 days.

One detail in that Worker I'd copy into anything that sends alerts. It sends the Telegram alert before it saves the new state:

  // Alert before saving: if Telegram fails, the transitions that needed an alert are not
  // saved, so the next minute sees the same transition and alerts again.
  const alerting = steps.filter(s => s.alert);
  const delivered = alerting.length === 0
    || await sendTelegram(env, alerting.map(s => alertText(s.check, s.alert)).join('\n\n'));

If the save came first and Telegram was down, the monitor would record that it had alerted, and nobody would ever hear about that outage.

The Worker lived six days. On November 1 the same checks moved to a small container on a VPS. A Worker can't reach anything on the LAN, so the router and NAS checks Kuma used to do had no home there either.

A broken edge in Hong Kong

The third one wasn't mine. On November 24 at 18:30 UTC, OpenRouter's Hong Kong edge started rejecting every inference call with 400 Request path cannot be relayed. Every request I send from Vietnam reaches OpenRouter through Cloudflare's Hong Kong data centre, including the gateway, which by then ran on a VPS. Every OpenRouter call failed, from every agent, whether it went through the gateway or not.

The cf-ray header on each response names the data centre that handled it. Calls that went through Singapore or Ashburn worked. Only Hong Kong was broken, and I had no say in which edge my traffic used.

A Cloudflare Worker can, though. Workers support placement hints, and a Worker pinned to Singapore makes its outgoing requests from there. This is the part of the deployment config that does it:

main = "worker.js"
compatibility_date = "2026-11-01"
[placement]
region = "aws:ap-southeast-1"

The Worker itself is about 60 lines. It checks a shared key with a timing-safe compare and refuses anything without it, forwards only /api/ paths, drops forwarding headers, doesn't follow redirects, and returns a JSON 502 if the upstream fetch fails. The gateway's OpenRouter provider got the Worker as its base URL. It went live on November 25 at 09:20, about eight hours after the outage started, and every call worked again.

The relay that stayed

Three hours later the relay picked up a second job. I wanted one model, DeepSeek Flash Latest, to always run on OpenRouter's fastest provider, which means asking for the :nitro variant. I wrote about what Nitro does in September. The gateway couldn't add it. Its virtual key allows models by catalog name and :nitro isn't in the catalog, and it drops OpenRouter's provider sort setting. The relay sits on the path anyway, so it rewrites the model name on the way through.

It does that with a regex on the request text instead of parsing the JSON, because some requests are several megabytes of conversation history and Workers on the free plan get very little CPU time. Quotes inside message text are escaped, so a conversation that mentions the model name can't match the pattern.

OpenRouter's Hong Kong edge recovered at 17:21 UTC on November 25, about 23 hours after it broke. The README still has the undo steps. On the 26th I decided to keep the relay. It runs on the free tier, it gives me Nitro, and if Hong Kong breaks again, my traffic already avoids it.

In all three cases the service was fine. What changed was where the request started. Kuma asked from inside the house, the first Worker asked from outside the country, and my model calls went through a city I never chose. Each fix was to start the request somewhere else.

More writing

All posts