mirror of
https://github.com/Such-Software/wowcheckout.git
synced 2026-10-17 05:51:45 +02:00
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:
@@ -57,7 +57,12 @@ server {
|
|||||||
|
|
||||||
location / {
|
location / {
|
||||||
set $ui_upstream "ui";
|
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_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|||||||
Reference in New Issue
Block a user