46 lines
1.3 KiB
Nginx Configuration File
46 lines
1.3 KiB
Nginx Configuration File
# nginx.conf (relevant bits)
|
||
events {}
|
||
|
||
http {
|
||
# This now governs idle close for HTTP/2, since http2_idle_timeout is obsolete.
|
||
keepalive_timeout 75s; # ← set to 60–80s to reproduce your prod-ish drop
|
||
|
||
# Good defaults for streaming
|
||
sendfile off; # avoid sendfile delays for tiny frames
|
||
tcp_nodelay on;
|
||
|
||
upstream app_upstream {
|
||
server host.docker.internal:3030;
|
||
keepalive 16;
|
||
}
|
||
|
||
server {
|
||
listen 8443 ssl; # ← no ‘http2’ here…
|
||
http2 on; # ← …use the standalone directive instead
|
||
server_name localhost;
|
||
|
||
ssl_certificate /etc/nginx/certs/cert.pem;
|
||
ssl_certificate_key /etc/nginx/certs/key.pem;
|
||
|
||
location / {
|
||
# Make SSE actually stream through NGINX:
|
||
proxy_buffering off; # don’t buffer
|
||
gzip off; # don’t compress
|
||
add_header X-Accel-Buffering no; # belt & suspenders for NGINX buffering
|
||
proxy_set_header Accept-Encoding ""; # stop upstream gzip (SSE + gzip = sad)
|
||
|
||
# Plain h1 to upstream is fine for SSE
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Connection "";
|
||
|
||
proxy_read_timeout 30s;
|
||
proxy_send_timeout 30s;
|
||
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Forwarded-For $remote_addr;
|
||
|
||
proxy_pass http://app_upstream;
|
||
}
|
||
}
|
||
}
|