Add 2 KB padding comment after headers to push past proxy buffer threshold, enable TCP_NODELAY on the socket, and remove erroneous chunked_transfer_encoding off from Nginx that caused full response buffering.
39 lines
1.2 KiB
Nginx Configuration File
39 lines
1.2 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;
|
|
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;
|
|
}
|
|
}
|