Replace the synchronous PDF import with Server-Sent Events streaming between the backend (LLM) and the browser. The user can now close the import modal and continue working while the conversion runs — a fixed progress bar in the Layout shows real-time stage and percentage.
40 lines
1.3 KiB
Nginx Configuration File
40 lines
1.3 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Import endpoint — SSE streaming, long timeout, no buffering
|
|
location /api/import {
|
|
proxy_pass http://family-budget-backend:3000;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
proxy_cookie_path / /;
|
|
proxy_connect_timeout 5s;
|
|
proxy_read_timeout 600s;
|
|
proxy_buffering off;
|
|
chunked_transfer_encoding off;
|
|
client_max_body_size 15m;
|
|
}
|
|
|
|
# API — проксируем на backend (сервис из docker-compose)
|
|
location /api {
|
|
proxy_pass http://family-budget-backend:3000;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
proxy_cookie_path / /;
|
|
proxy_connect_timeout 5s;
|
|
proxy_read_timeout 30s;
|
|
}
|
|
|
|
# SPA — все остальные пути отдаём index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|