From 3ecca4cd09683ff74d684a5fa6c276d0f05f9913 Mon Sep 17 00:00:00 2001 From: patrick Date: Fri, 4 Sep 2026 00:24:58 +0200 Subject: [PATCH] deploy: nginx liefert React-PWA-Build statt Backend-Proxy auf / /api/ geht weiter an Uvicorn, / serviert frontend/dist mit try_files-Fallback auf index.html (react-router-dom routet im Client). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01L85hmKbvX7Cqkq47KnQhFt --- deploy/nginx_mabea.conf.template | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/deploy/nginx_mabea.conf.template b/deploy/nginx_mabea.conf.template index eee4eae..9880e84 100644 --- a/deploy/nginx_mabea.conf.template +++ b/deploy/nginx_mabea.conf.template @@ -23,11 +23,20 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } - location / { + location /api/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + # React-PWA (Sprint 7): statische Build-Ausgabe von frontend/dist. + # try_files statt 404 bei Client-Routen, da react-router-dom im Browser routet. + root /var/www/mabea; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } }