From bfc61fb64e095e24d1530e0aa9480d1597baff56 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 26 Nov 2024 16:07:27 +0100 Subject: [PATCH 1/3] client_max_body_size is a parameter of nginx.conf and not of default.conf (https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size ) add client_body_buffer_size prevents the following logs: [warn] a client request body is buffered to a temporary file --- debian/nginx/conf.d/default.conf | 2 -- debian/nginx/nginx.conf | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/nginx/conf.d/default.conf b/debian/nginx/conf.d/default.conf index 758d675..2daeec3 100644 --- a/debian/nginx/conf.d/default.conf +++ b/debian/nginx/conf.d/default.conf @@ -8,8 +8,6 @@ server { server_tokens off; - client_max_body_size 100M; - root /var/www/html/public; index index.php; diff --git a/debian/nginx/nginx.conf b/debian/nginx/nginx.conf index 919f25c..2ee6e48 100644 --- a/debian/nginx/nginx.conf +++ b/debian/nginx/nginx.conf @@ -22,5 +22,8 @@ http { keepalive_timeout 65; gzip on; + client_max_body_size 100M; + client_body_buffer_size 100M; + include /etc/nginx/conf.d/*.conf; -} \ No newline at end of file +} From 3ce5983131b8af6fbc46c9879cebeb9e85986f73 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 26 Nov 2024 16:22:38 +0100 Subject: [PATCH 2/3] Prevents swapping on pdf generation with Chrome Increase allowed memory usage of main container from 512M to 1G This is useful particularly if the server uses a hard drive, which can drastically slow down pdf generation during swap --- debian/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/docker-compose.yml b/debian/docker-compose.yml index 8442269..5ccd4b2 100644 --- a/debian/docker-compose.yml +++ b/debian/docker-compose.yml @@ -31,6 +31,7 @@ services: resources: limits: memory: 512M + #memory: 1G # prevents swapping on pdf generation with chrome logging: *default-logging nginx: From f5afd3f527c96ece0195eac20d46fae782e1ece0 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 26 Nov 2024 16:28:04 +0100 Subject: [PATCH 3/3] Revert "Prevents swapping on pdf generation with Chrome" This reverts commit 3ce5983131b8af6fbc46c9879cebeb9e85986f73. --- debian/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/docker-compose.yml b/debian/docker-compose.yml index 5ccd4b2..8442269 100644 --- a/debian/docker-compose.yml +++ b/debian/docker-compose.yml @@ -31,7 +31,6 @@ services: resources: limits: memory: 512M - #memory: 1G # prevents swapping on pdf generation with chrome logging: *default-logging nginx: