NanumFlare edge — a cache and guard in front of your site
What it is
The NanumFlare edge stands between visitors and the real site (the origin server). Visitors only talk to the edge; it keeps what it fetched from the origin (a cache) and hands it straight to the next visitor. It pauses an address that knocks too often, and when the origin is down it shows a "We can't reach this site right now" page. acme gets its HTTPS certificate. Add -E to NanumOS's web server (httpsd) to turn it on.
Basics
Think of a library's lending desk. Visitors only come to the desk; the desk keeps the most-asked books (pictures, videos, fonts) on a shelf beside it and hands them out without walking to the stacks (the origin). When the stacks close for a in the terminal to see whether the edge is running (no file = not turned on yet).
How to use it
- Changes: edit the file and it is read again within 2 seconds, with the cache emptied (no restart). A wrong line keeps the old setting and logs the line number. Missing or wrong from the start: the server starts with no sites (it never stops).
- Check: the answer's
X-Cacheheader saysHIT(from the cache),MISS(from the origin),BYPASS(a logged-in request, never cached) orSTALE(the origin is down; the last copy). Ask the assistant "is the edge OK?" and it reads the "NanumFlare edge" row of the system check (os_check).
- Pass only certificate checks:
acme-onlyat the end of the line — for a box that holds its own copy of the site (-M) while several servers share one name: when Let's Encrypt comes to any of them to check the name, only/.well-known/acme-challenge/goes to the origin; everything else is answered from this box's copy.
How it works
- A visitor asks for
https://www.example.org/picture.png; httpsd opens the TLS and looks at the Host. A name that is not in the file is never passed on — so the edge is not an "open proxy" that fetches any address for anyone. A request that names a whole address (GET http://elsewhere/) is refused with 400. - In the cache and still fresh: answered at once (
HIT). Otherwise one HTTP/1.0 request goes to the origin (with X-Forwarded-For and X-Forwarded-Proto), and the answer flows to the visitor while it is kept. When several visitors ask for the same thing at once, they read the one fetch together. - The origin's
Cache-Controldecides what is kept:no-store,private,no-cache,Set-Cookieand logged-in requests are not;s-maxage, thenmax-age, then (no Cache-Control) static files like pictures, fonts and video forttl.immutableor a hashed name: a year, and the browser is told it may keep it a year too. - Video is asked for in pieces (
Range). Even the first time the edge fetches the whole file from the origin and hands out the piece asked for first (206); once it has it all, the next pieces come from the edge. - Guarding: requests per second are counted per address (over it: 429 and "Too many requests"). A slow visitor that does not send its whole header in 5 seconds is cut off (slowloris). One address is served on at most 16 connections at once; a few more from it wait their turn (a proxy or a shared office line is many people), and an address that holds its connections without sending is cut off at once. An origin that does not answer in 10 seconds gives 504, one that cannot be reached 502, with the friendly page — or the last copy (
STALE) when there is one. - DNS-01 certificates: hand
_acme-challenge.www.example.orgto this device's NanumDNS (one NS line in the parent zone);acmewrites a TXT line into that zone file, dnsd reads it again within a second, acme asks this device's port 53 to see it, then tells Let's Encrypt to check. The line is removed afterwards. Port 80 is not needed.
Technical details
- Code:
user/cmds/edge.h(inside httpd.c,-E),user/tls/acme.c(--dns-zone), the check rowuser/zeus/zeus.pyedge_row. Contractdocs/contracts/EDGE.md. - Limits today: only GET and HEAD are passed on (no POST, no WebSocket), the origin is an IPv4 address, the cache is in memory (empty after a restart), and a large attack is absorbed only up to the rented line's size (not a network spread over the world).
Frequently asked
- How do I empty the cache? Save the setting file (the same content with a new time is enough): within 2 seconds it is empty.
- Does the origin see the visitor's address? In the
X-Forwarded-Forheader. The same header sent by a visitor is dropped; only the address the edge saw is written.
NanumOS 0.1.15511 · 2026-11-25