Edgeweir
Nodes

Node configuration

Environment variables and flags of the node service: paths, network, shared memory, GeoIP, kernel bans, image conversion, logs, resource limits and old workers.

The console sends sites, cache, rules and the rest of the configuration; the flags below are set on the node only and the console cannot change them. Upgrade flags: Node upgrades.

Setting values

MethodWhereTakes effect
Environment file (deb, rpm, tar.gz)/etc/default/edgeweir-node, one EDGEWEIR_<FLAG>=<value> per line; the file the packages install is all comments, and package upgrades keep local editssudo systemctl restart edgeweir-node
systemd drop-in/etc/systemd/system/edgeweir-node.service.d/<name>.confsudo systemctl daemon-reload && sudo systemctl restart edgeweir-node
Containerdocker run -e EDGEWEIR_<FLAG>=<value>, or environment in ComposeRecreate the container
Command lineedgeweir-node supervise --manage-nginx --<flag> <value>Wins over environment variables
RuleDetail
Variable namesEDGEWEIR_ plus the flag name in upper case with - as _: --stream-shutdown-timeout → EDGEWEIR_STREAM_SHUTDOWN_TIMEOUT
Booleanstrue, false
DurationsGo duration format: 500ms, 30s, 10m, 2h
PathsAbsolute, without spaces or special characters
ValidationEvery flag is checked at startup; an invalid value ends the process with exit status 2 and systemd does not restart it (RestartPreventExitStatus=2); the reason is in journalctl -u edgeweir-node -n 20
Unit presetsThe systemd unit sets EDGEWEIR_NGINX_BIN=/usr/lib/edgeweir-openresty/nginx/sbin/nginx and EDGEWEIR_LUA_DIR=/usr/share/edgeweir-node/lua; the same variables in the environment file override them
Image presetsEDGEWEIR_STATE_DIR, EDGEWEIR_NGINX_BIN, EDGEWEIR_LUA_DIR, EDGEWEIR_CACHE_DIR, EDGEWEIR_CONTROL_SOCKET, EDGEWEIR_ORIGIN_SOCKET are set to the default paths

Example:

/etc/default/edgeweir-node
EDGEWEIR_LOG_FORMAT=json
EDGEWEIR_RESOLVER=1.1.1.1,8.8.8.8
EDGEWEIR_STREAM_SHUTDOWN_TIMEOUT=30m

Flags

supervise and run take the same flags.

Paths and processes

FlagDefaultDescription
--state-dir/var/lib/edgeweir-nodeState directory: identity, LKG configuration, key material
--cache-dir/var/cache/edgeweir-nodeParent directory of the cache zones
--manage-nginxfalseThe node runs OpenResty; required for supervise
--nginx-bin/usr/lib/edgeweir-openresty/nginx/sbin/nginx (when present), otherwise openresty from PATHOpenResty binary
--nginx-prefix<state-dir>/nginxnginx prefix directory
--nginx-useremptyUser of the nginx workers when the agent runs as root; not needed with the systemd unit or the image, which do not run as root
--lua-dir/usr/share/edgeweir-node/luaDirectory containing edgeweir/*.lua
--worker-processesautonginx worker_processes
--default-port80HTTP port served before any configuration, 1–65535
--control-socket/run/edgeweir-node/control.sockData plane control API
--diag-socket/run/edgeweir-node/diag.sockDiagnostics socket (0600); empty turns it off, and the agent and configuration checks of diagnose then fail
--origin-socket/run/edgeweir-node/origin.sockInternal origin layer; the HTTP/2 and gRPC origin layers are in the same directory
--origin-socket-noverifyorigin-noverify.sock next to the origin socketOrigin layer without certificate verification
--edge-socketedge.sock next to the control socketLocal edge listener for prefetching
--l4-socketl4.sock next to the control socketControl relay of the stream subsystem

Network and resolution

FlagDefaultDescription
--listen-ipv6autoListen on IPv6: auto (when the host can bind IPv6), on, off
--resolver-ipv6autoResolve AAAA records of origins: auto (when the host has a global IPv6 address), on, off
--resolv-conf/etc/resolv.confSource of the nginx resolvers
--resolveremptyComma-separated resolver addresses; --resolv-conf is not read when set
--trusted-cathe system CA fileCA file for HTTPS origin certificates (origin fetches and active health checks); the default is the first of /etc/ssl/certs/ca-certificates.crt, /etc/pki/tls/certs/ca-bundle.crt, /etc/ssl/ca-bundle.pem, /etc/ssl/cert.pem

Shared memory and capacity

Every *-dict-mb takes 1–65536 (MiB). A site table or layer-4 table that does not fit fails the apply, and the reason names the flag to raise.

FlagDefaultDescription
--sites-dict-mb64Site table (edgeweir_sites): current and previous site tables, error page templates included
--l4-dict-mb32Layer-4 table (edgeweir_l4): current and previous, IP lists included
--stats-dict-mb16Statistics counters (edgeweir_stats), drained by the agent every minute
--purge-dict-mb32Purge markers (edgeweir_purge)
--purge-markers-per-site1000URL and prefix markers per site before they collapse into one site-wide marker
--purge-tags-per-site5000Tag markers per site before they collapse into one site-wide marker
--tag-dict-mb64Cache-Tag index (edgeweir_tags), LRU eviction when full
--ban-capacity100000Dynamic bans held, 1–10000000; the oldest automatic bans go first when full
--ban-dict-mb32Ban store (edgeweir_bans)
--cc-dict-mb32CC mitigation store (edgeweir_cc)
--challenge-dict-mb8Challenge store (edgeweir_challenge)
--rate-limit-dict-kb256Rate-limit counters of each published site (edgeweir_rate_<hex site ID>), 64–65536 KiB; new counts pass when full

Tasks and reporting

FlagDefaultDescription
--prefetch-budget4mTime one pulled batch of prefetch tasks may take, above 0; the console hands unfinished tasks out again after 5 minutes
--cache-usage-interval10mHow often the cache zones' disk usage is measured (a walk over the cache directory), at least 1s
--stats-interval1mHow often statistics are drained and uploaded, 1s–1m

Security modules

FlagDefaultDescription
--kernel-bansautoWrite platform bans to nftables: auto (when nft runs and CAP_NET_ADMIN is held), off; see Kernel bans
--nft-binnftnftables binary
--modsecurity-moduleautoModSecurity dynamic module: auto (modules/ of the edgeweir-openresty that --nginx-bin belongs to), a path, off; loaded only when a site enables the OWASP CRS
--crs-dir/usr/share/edgeweir-openresty/crsOWASP CRS directory (crs-setup.conf, rules/); must not be empty

The node reports modsecurity-v1 when the module and the CRS exist and a load test passes; without it, sites with the OWASP CRS cannot be served by that node.

GeoIP

FlagDefaultDescription
--geoip-ipinfoautoIPinfo Lite MMDB (countries, ASNs): auto (the image's bundled /usr/share/edgeweir-node/geoip/ipinfo_lite.mmdb, unused when absent), off, a path
--geoip-cityemptyCity MMDB (subdivisions; also countries IPinfo does not have)
--geoip-asnemptyASN MMDB (ASNs IPinfo does not have)
ItemDetail
Bundled dataOnly the container image bundles IPinfo Lite; the deb, rpm and tar.gz carry no GeoIP data, so point --geoip-ipinfo or --geoip-city / --geoip-asn at files when needed
LookupsDone on the node; no download at run time, visitor addresses are not sent to third parties
UpdatesReplace the file or pull a new image, then restart the node service
Capabilitiesgeoip-city-v1 with country data, geoip-asn-v1 with ASN data, geoip-subdivision-v1 with a City MMDB; a configuration whose rules read GeoIP fields the node has no data for is refused, see Node capabilities
File accessFiles must be readable by the edgeweir user; the systemd unit's file system is read-only except the state, cache and runtime directories, so keep the files under existing directories such as /usr/share or /var/lib

Image conversion

FlagDefaultDescription
--image-workersmin(4, max(1, CPUs / 2))Concurrent WebP / AVIF conversions, 0–64; each is a child process on one CPU. 0 turns conversion off: the node does not report image-convert-v1 and sites that convert cannot be served by it
--image-memory-mb1024Memory the running conversions may use together, 64–1048576 MiB; estimated from the pixels, the original is returned when it would not fit
--image-timeout8sLongest single conversion, 1s–5m; the child is killed and the original returned

Logs

FlagDefaultDescription
--log-levelinfodebug, info, warn, error; written to standard error (the journal under systemd)
--log-formattexttext, json
--debug-log-buffer5000Recent log entries of every level kept in memory (at most 4 MiB), 0–100000; 0 turns it off and the node does not report debug-logs-v1, see Debug logs

Upgrades (supervise)

FlagDefaultDescription
--cosign-bincosignSignature verifier
--upgrade-sourcehttps://github.com/marvinli001/edgeweir-node/releases/downloadRelease source trusted by this node; upgrade tasks cannot change it
--upgrade-public-keyemptyOperator-provided release public key; when empty, the GitHub OIDC identity of the official release workflow is checked
--upgrade-allow-httpfalseAllow a plaintext HTTP release source (local tests, air-gapped networks)
--upgrade-allow-downgradefalseLet upgrade tasks install a version older than the running one

How long old workers stay

After a reload, old workers serve existing connections (layer-4 sessions, HTTP keep-alive, WebSocket) until they end by default; frequent structural changes leave several generations of old workers.

--stream-shutdown-timeoutBehavior
0 (default)No limit; old workers exit after their last connection ends
A duration such as 30m or 2hAfter that time the old workers close every connection they still serve (nginx worker_shutdown_timeout); layer-4, HTTP and WebSocket connections alike
/etc/default/edgeweir-node
EDGEWEIR_STREAM_SHUTDOWN_TIMEOUT=30m

Container nodes use -e EDGEWEIR_STREAM_SHUTDOWN_TIMEOUT=30m. Layer-4 details: Reloads and long connections.

Kernel bans

Platform bans are enforced at the HTTP layer (403) by default. With kernel bans, nftables (table inet edgeweir) drops inbound packets of banned addresses and the node reports kernel-ban-v1, see Bans.

DeploymentSteps
systemdInstall nftables (recommended by the deb and rpm); create the drop-in below; sudo systemctl daemon-reload && sudo systemctl restart edgeweir-node; the log line kernel bans active: nftables table inet edgeweir confirms it
ContainerBuild the image with docker build --build-arg NFT_CAPABILITY=true (adds cap_net_admin+ep to /usr/sbin/nft) and start the container with --cap-add NET_ADMIN (Compose: cap_add: [NET_ADMIN]); the published image does not carry the file capability
/etc/systemd/system/edgeweir-node.service.d/kernel-ban.conf
[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
ItemDetail
MatchingBy the TCP connection's source address; behind a PROXY protocol load balancer or a layer-7 proxy only their addresses are seen, see Load balancers in front of nodes
OutboundEvery inbound packet of a banned address is dropped, so the node cannot connect to it either (for example when it is an origin)
Layer-4 applicationsDynamic bans reach layer-4 applications only through the kernel
FailureWithout a working nft or the capability, bans fall back to the HTTP layer

Resources and kernel parameters

ItemValue
Open filesUnit LimitNOFILE=1048576; the node raises its soft limit to the hard limit and sets worker_rlimit_nofile to the hard limit (at most 1048576)
worker_connections4096; half the hard limit (at least 256) when the hard limit is below 8192; raised with the number of listening sockets for port ranges
Privileged portsThe unit grants only CAP_NET_BIND_SERVICE (inherited by OpenResty); the nginx master binds 80, 443 and extra ports below 1024; the container runs as uid 10001 and binds inside its network namespace
Kernel parametersThe node changes no sysctl
MemoryThe shared memory above, plus --rate-limit-dict-kb per published site, plus --image-memory-mb for image conversion
DiskCache zone sizes are set in the console (per cluster or per node), see Cache zones; spool files in the state directory have their own limits
CPUworker_processes auto runs one worker per CPU; sites with the OWASP CRS cost about 0.5 ms of CPU more per request
systemd hardeningProtectSystem=strict, NoNewPrivileges=yes, PrivateTmp=yes, RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK, SystemCallFilter=@system-service; MemoryDenyWriteExecute is not set (LuaJIT needs it off)
Edit on GitHub

On this page