forked from triggerdotdev/trigger.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
45 lines (35 loc) · 1.33 KB
/
nginx.conf
File metadata and controls
45 lines (35 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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;
}
}
}