nexus-proxy
The front that ships with the platform. It stands in front of the engines’ HTTP and gRPC doors, terminates TLS there and hands each request to one engine. It comes in every kit and in its own image.
What it does in front of the engines
nexus-proxy listens for HTTP and, when it is configured, for gRPC. It hands each request to an engine in round robin, in the order the configuration lists them, and skips an engine out of the turn without reordering the others.
- An engine whose readiness check fails leaves the turn and comes back when it passes. Each change is one line in the error log.
- An engine that refuses the connection is marked unhealthy at once, and the request goes to the next one.
- With no healthy engine, the answer is
503and no engine is contacted. - Over gRPC, a call’s messages, status and trailers reach the client byte for byte.
- Forwarding headers a client forged never reach an engine, and neither do hop-by-hop headers.
No resend once a request reached an engine
The proxy tries another engine only while no engine has received the request. Once one has, the request is not sent to a second engine, for POST, GET, PUT and DELETE alike, and over gRPC too. No request reaches two engines.
| What the engine does | HTTP | gRPC status |
|---|---|---|
| Refuses the connection | The next engine is tried | The next engine is tried |
| Every engine refuses | 502, after one try each | 14, no engine reachable |
| Closes after receiving the request | 502 | 13 |
| Sends no answer in time | 504 | 4 |
TLS and client certificates
TLS ends at nexus-proxy, in front of the engines. The engines themselves do not terminate it.
- TLS 1.2 and TLS 1.3, and HTTP/2 at the front. The engine receives HTTP/1.1, with
X-Forwarded-Proto: https. - Client certificates in
requiredmode: a missing, foreign or expired certificate fails the handshake, and the engine sees nothing. - Revocation from CRL files on disk: a revoked certificate, an unknown revocation status or a stale CRL fails the handshake.
- A certificate revoked in a CRL file replaced on disk is refused, without a restart. A replacement the proxy cannot parse keeps the previous list in force, and the error log says so.
- The engine receives the certificate in
Client-Certonly from the verified session, never from a header the client sent. - With client certificates on, each new connection is a full handshake, never a resumed session.
- The gRPC listener does the same over TLS: the certificate comes from the verified session, and one revoked after a CRL reload is refused.
Two logs, written and rotated by the proxy
An access log with one line per request, and an error log with the proxy’s own events: an engine leaving or rejoining the turn, a failed attempt on an engine, a CRL reload.
- Every access line has the same fixed keys, whatever the protocol.
- A failed attempt and the access line of its request share one
request_id. - A secret in the query, the
Referer, a credential header or the body reaches neither log. - Rotation by size, with no line lost, or by time. Retention, by count and by age, deletes only the proxy’s own rotated files.
- A log file the proxy creates gets mode
0640. - Without a log path, access lines go to standard output and the proxy’s own events to standard error.
Two machines, one address
Started with --vrrp, nexus-proxy carries one virtual address between two VMs over VRRP, for IPv4 and for IPv6. When the proxy or the machine holding the address stops, the address moves to the other VM, and it comes back when the first one returns. With preemption off on both, it stays where it moved.
- Each machine checks that the local answer comes from the nexus-proxy account. If another account answers, the machine gives the address up, and holds it again once the proxy is back.
- Announcements from a router that is not the configured peer are refused, so a third router does not take the address.
- The privileges are split between two processes: the proxy holds only the right to bind a low port, and the VRRP process only the two network rights it needs, with no listening socket.
How it ships
- In every kit, beside the engine: a static program that loads no shared library from the system.
- In its own image, built apart from the engine’s, holding only
nexus-proxy, run as a non-root user. - Each image archive is signed and attested with our key.
- Its dependencies are checked against security advisories together with the platform’s.
- It has its own version, separate from the engine’s.
Keeping your own front
A site that already runs a load balancer or reverse proxy may keep it in front of the engines, in place of nexus-proxy. TLS then terminates there, never in the engine.
That front can pass on the client certificate it verified. The engine takes it only from a front named with --trusted-proxy, on both its doors, and identifies the caller by the issuer and subject registered with nexus tenant client-cert add. Checking the chain, the dates and the revocation stays with the front.
- Two engines behind nexus-proxyInstall it from the kit or from its image, with every configuration key.
- nexus-proxy logsEvery key of both logs, rotation and retention.
- The virtual addressWhat
--vrrpdoes, and what it needs from the network. - High availability on two VMsTwo VMs, each with an engine and nexus-proxy, step by step.
- ArchitectureWhy one program: what runs inside it, and what stays yours.
- OperatingWhat the running process owns, and what a restart asks of you.