6cf5bf76b3
The frontend builds with VITE_API_URL=/api so all API calls target the same origin. Without a proxy rule, nginx was serving index.html for API paths, causing JSON parse errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
542 B
Nginx Configuration File
26 lines
542 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
location /api/ {
|
|
proxy_pass http://server:3001;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location /health {
|
|
proxy_pass http://server:3001;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /assets/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
}
|