From 4dc2b1b8c37dd46ace56e73842e124ca987472cc Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Thu, 6 Nov 2025 08:18:46 -0500 Subject: [PATCH] Fix nginx configuration in Ubuntu installer for large file uploads - Add client_max_body_size 100G to both HTTP and HTTPS nginx configs - Increase client_body_timeout and client_header_timeout for large uploads - Update proxy timeouts to 300s for better handling of large files - Disable proxy_buffering and proxy_request_buffering for large uploads - This resolves 413 Request Entity Too Large errors from nginx --- ubuntu-install.sh | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/ubuntu-install.sh b/ubuntu-install.sh index e78d1cd..7972901 100644 --- a/ubuntu-install.sh +++ b/ubuntu-install.sh @@ -220,6 +220,11 @@ server { ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384; ssl_prefer_server_ciphers off; + # Large file upload settings + client_max_body_size 100G; + client_body_timeout 300s; + client_header_timeout 60s; + # Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-XSS-Protection "1; mode=block" always; @@ -242,9 +247,13 @@ server { proxy_set_header Connection "upgrade"; # Timeout settings - proxy_connect_timeout 60s; - proxy_send_timeout 60s; - proxy_read_timeout 60s; + proxy_connect_timeout 300s; + proxy_send_timeout 300s; + proxy_read_timeout 300s; + + # Disable buffering for large uploads + proxy_buffering off; + proxy_request_buffering off; } # Static files @@ -262,6 +271,11 @@ server { listen 80; server_name $DNS_DOMAIN; + # Large file upload settings + client_max_body_size 100G; + client_body_timeout 300s; + client_header_timeout 60s; + # Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-XSS-Protection "1; mode=block" always; @@ -283,9 +297,13 @@ server { proxy_set_header Connection "upgrade"; # Timeout settings - proxy_connect_timeout 60s; - proxy_send_timeout 60s; - proxy_read_timeout 60s; + proxy_connect_timeout 300s; + proxy_send_timeout 300s; + proxy_read_timeout 300s; + + # Disable buffering for large uploads + proxy_buffering off; + proxy_request_buffering off; } # Static files