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
This commit is contained in:
1 parent
f4611c5aa4
commit
4dc2b1b8c3
1 file changed
+24
-6
+24
-6
@@ -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_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384;
|
||||||
ssl_prefer_server_ciphers off;
|
ssl_prefer_server_ciphers off;
|
||||||
|
|
||||||
|
# Large file upload settings
|
||||||
|
client_max_body_size 100G;
|
||||||
|
client_body_timeout 300s;
|
||||||
|
client_header_timeout 60s;
|
||||||
|
|
||||||
# Security headers
|
# Security headers
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-XSS-Protection "1; mode=block" always;
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
@@ -242,9 +247,13 @@ server {
|
|||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
# Timeout settings
|
# Timeout settings
|
||||||
proxy_connect_timeout 60s;
|
proxy_connect_timeout 300s;
|
||||||
proxy_send_timeout 60s;
|
proxy_send_timeout 300s;
|
||||||
proxy_read_timeout 60s;
|
proxy_read_timeout 300s;
|
||||||
|
|
||||||
|
# Disable buffering for large uploads
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Static files
|
# Static files
|
||||||
@@ -262,6 +271,11 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name $DNS_DOMAIN;
|
server_name $DNS_DOMAIN;
|
||||||
|
|
||||||
|
# Large file upload settings
|
||||||
|
client_max_body_size 100G;
|
||||||
|
client_body_timeout 300s;
|
||||||
|
client_header_timeout 60s;
|
||||||
|
|
||||||
# Security headers
|
# Security headers
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-XSS-Protection "1; mode=block" always;
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
@@ -283,9 +297,13 @@ server {
|
|||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
# Timeout settings
|
# Timeout settings
|
||||||
proxy_connect_timeout 60s;
|
proxy_connect_timeout 300s;
|
||||||
proxy_send_timeout 60s;
|
proxy_send_timeout 300s;
|
||||||
proxy_read_timeout 60s;
|
proxy_read_timeout 300s;
|
||||||
|
|
||||||
|
# Disable buffering for large uploads
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Static files
|
# Static files
|
||||||
|
|||||||
Reference in new issue
Block a user