Files
2026-07-13 13:32:57 +08:00

46 lines
1.3 KiB
Nginx Configuration File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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 6080s 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; # dont buffer
gzip off; # dont 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;
}
}
}