diff --git a/ui/nginx.conf b/ui/nginx.conf index adc394a28aa..57aafa71b4c 100644 --- a/ui/nginx.conf +++ b/ui/nginx.conf @@ -76,9 +76,16 @@ http { # /ui[/] — the dashboard's JS hardcodes URLs under this prefix # (router.replace("/ui"), buildLoginUrlWithReturn("/ui/login"), ...). # Mirror what FastAPI StaticFiles(mount="/ui") did in the monolithic - # proxy_server: serve /ui/ from out/.html, with App - # Router-aware fallback (out//index.html) and a final SPA - # fallback to out/index.html for client-side routes. + # proxy_server: serve /ui/assets/... from out/assets/... and serve + # /ui/ from out/.html, with App Router-aware fallback + # (out//index.html) and a final SPA fallback to out/index.html + # for client-side routes. + location ^~ /ui/assets/ { + alias /usr/share/nginx/html/assets/; + try_files $uri =404; + expires 1y; + add_header Cache-Control "public, immutable"; + } location = /ui { try_files /index.html =404; } location = /ui/ { try_files /index.html =404; } location ~ ^/ui/(.+)$ {