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/<invoice> 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.
This commit is contained in:
jwinterm
2026-07-16 09:02:44 -04:00
parent ac87dea273
commit 3e672f8323
+6 -1
View File
@@ -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/<invoice>), 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;