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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L85hmKbvX7Cqkq47KnQhFt
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user