Skip to content

Commit 582adbe

Browse files
attempt nginx fix
1 parent 4f1834f commit 582adbe

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

backend/nginx/api.conf

+12-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ server {
2020
proxy_buffering off;
2121
proxy_cache off;
2222
proxy_http_version 1.1;
23-
proxy_set_header Connection '';
23+
24+
# Update connection header handling
25+
proxy_set_header Connection ''; # Keep this empty for HTTP/1.1 chunked transfer
2426
proxy_set_header X-Real-IP $remote_addr;
2527
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2628
proxy_set_header Host $host;
@@ -38,6 +40,12 @@ server {
3840
# Keep connection alive
3941
keepalive_timeout 300s;
4042
keepalive_requests 1000;
43+
44+
# Add these new settings
45+
proxy_set_header Upgrade $http_upgrade;
46+
proxy_set_header Connection "upgrade";
47+
proxy_read_timeout 86400s; # 24 hours - prevent timeout during long streams
48+
client_max_body_size 10M; # Increase if needed
4149
}
4250

4351
# Return 444 for everything else (no response, just close connection)
@@ -52,6 +60,9 @@ server {
5260
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
5361
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
5462

63+
# Add this at the server level (outside location blocks)
64+
client_header_timeout 300s;
65+
client_body_timeout 300s;
5566
}
5667
server {
5768
if ($host = api.gitdiagram.com) {

0 commit comments

Comments
 (0)