Skip to content

fix(ark-ui): pin the nginx upstreams to 127.0.0.1 - #119

Merged
dakejahl merged 1 commit into
mainfrom
dakejahl/nginx-ipv4-upstream
Sep 1, 2026
Merged

dakejahl merged 1 commit into
mainfrom
dakejahl/nginx-ipv4-upstream

Conversation

@dakejahl

@dakejahl dakejahl commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Every /api/ route can answer 502 while the front page serves 200.

Problem

services/ark-ui-backend/index.js binds the gateway to 127.0.0.1 deliberately, but frontend/ark-ui.nginx proxied to localhost, which /etc/hosts maps to both 127.0.0.1 and ::1. When nginx resolves the v6 address the connection is refused:

connect() failed (111: Connection refused) while connecting to upstream,
upstream: "http://[::1]:3000/api/system/info"

The failure is silent from the outside: nginx still serves the SPA at /, so the UI loads and every API call fails.

Found on a Modalix JAJ, where it reproduced on each boot — the gateway answered 200 on :3000 and each manager answered 200 directly the whole time. Restarting nginx cleared it, which is why it presents as intermittent: a Modalix PAB V3 on the same package passed the same checks.

Solution

Pin both upstreams to 127.0.0.1, matching the /video upstream on line 57 which was already pinned. Verified on hardware across a cold boot: 502 -> 200 on all three manager routes.

The gateway binds 127.0.0.1 by design, but nginx proxied to localhost, which
/etc/hosts also maps to ::1. When nginx picks the v6 address the connection is
refused and every /api/ route answers 502 while the front page still serves 200.

Reproduced on a Modalix JAJ: 502 on each boot, gateway healthy on :3000
throughout, cleared by restarting nginx and fixed permanently by this change
(verified across a cold boot). The /video upstream on line 57 was already
pinned; this makes the other two match.
@dakejahl
dakejahl merged commit 09ae056 into main Sep 1, 2026
4 checks passed
@dakejahl
dakejahl deleted the dakejahl/nginx-ipv4-upstream branch September 1, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant