From 3e672f8323b951355fa03dace1dad9e1d9fbe0ec Mon Sep 17 00:00:00 2001 From: jwinterm Date: Thu, 16 Jul 2026 09:02:44 -0400 Subject: [PATCH] fix(nginx): drop trailing slash on variable ui proxy_pass With a variable upstream ($ui_upstream, added for docker-DNS re-resolution), a trailing-slash URI in proxy_pass makes nginx forward '/' to the UI for every sub-path, so /_next/static/*.css and /i/ all return the app index HTML (200 text/html) -> the UI renders unstyled and client routing breaks. Omit the URI to preserve the full request path, matching the /api/ block. --- nginx/conf.d/default.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 86ac7fd..1516914 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -57,7 +57,12 @@ server { location / { set $ui_upstream "ui"; - proxy_pass http://$ui_upstream:3000/; + # No trailing-slash URI: with a VARIABLE upstream, a trailing "/" makes + # nginx send "/" to the UI for every sub-path (assets, /i/), so + # the app's index HTML is returned for /_next/static/*.css (200 text/html) + # → the whole UI renders unstyled and client routing dies. Omit the URI so + # the full request path is preserved, exactly like the /api/ block above. + proxy_pass http://$ui_upstream:3000; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;