TGW-01 / REVERSE PROXY, CONSISTENT-HASH LOAD BALANCING & API GATEWAY

Terminate once.
Route deterministically.
Fail closed.

A guarded Nginx edge distributes stateless site traffic across three isolated instances using consistent client-IP hashing while API traffic remains pinned to one append-only protocol authority.

01TERMINATE
02IDENTIFY
03LIMIT
04HASH
05ROUTE
06FAILOVER
07CORRELATE
08VERIFY
09GUARD
10ROLLBACK
0102030405
FIVE GATEWAY PROFILES
ONE GUARDED PUBLIC EDGE
01 / EDGE TOPOLOGYTLS + PROXY + HASH + LIMIT

Three stateless site workers.
One proof writer.

SITE NODE 01

127.0.0.1:3100

CONSISTENT-HASH MEMBER

Passive failure detection, bounded upstream timeouts and keepalive reuse. The existing port 3100 instance remains inside the pool during migration.

STATELESSIP AFFINITY
SITE NODE 02

127.0.0.1:3102

CONSISTENT-HASH MEMBER

Passive failure detection, bounded upstream timeouts and keepalive reuse. The existing port 3100 instance remains inside the pool during migration.

STATELESSIP AFFINITY
SITE NODE 03

127.0.0.1:3103

CONSISTENT-HASH MEMBER

Passive failure detection, bounded upstream timeouts and keepalive reuse. The existing port 3100 instance remains inside the pool during migration.

STATELESSIP AFFINITY
PROTOCOL AUTHORITY

127.0.0.1:3200

SINGLE WRITER

All `/api/v1/` traffic is rate-limited, request-correlated and routed to the sole append-only ledger authority. Automatic write replay across replicas is prohibited.

SPLIT-BRAIN PREVENTEDWRITE SAFE
PER-CLIENT CONTROLS
30 READS / SEC5 WRITES / SEC40 CONNECTIONS64 KiB API BODYVALID REQUEST IDDIRECT IP ONLY
Client-supplied forwarding headers are discarded. The connection address is the affinity and rate-limit key unless a future trusted-CDN policy is explicitly installed.
02 / GATEWAY ASSURANCEAWAITING STATE
ROUTING DECISION

STATELESS TRAFFIC SCALES. LEDGER WRITES STAY SINGULAR.

Consistent hashing preserves client affinity and cache locality across the site pool. Passive failover contains a dead site worker. Rate, connection, body and timeout bounds protect the API authority without trusting spoofable forwarding headers.

01TLSWAIT
02PROXYWAIT
03AFFINITYWAIT
04POOLWAIT
05FAILOVERWAIT
06APIWAIT
07LIMITSWAIT
08IDENTITYWAIT
09FORWARDINGWAIT
10BOUNDSWAIT
11ROLLBACKWAIT
12ASSURANCEWAIT
GATEWAY INVARIANTSTGW-01CONSISTENT HASH BINARY REMOTE ADDR
PASSIVE FAILOVER / TRUEROLLBACK / TRUECLIENT XFF TRUST / FALSE