From 0b3ca8db69e51a6a00cf6c05aadd58b0340d9163 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 5 Jul 2024 13:07:45 +0530 Subject: [PATCH] [server] Increase HTTP request body size to prevent 413 Too Large errors Allow HTTP request body up to 4 MB. The default is 1 MB, which is too small for face embeddings for photos with more than a couple of hundred faces. Roughly, each face embedding is 4KB, but encrypting and base-64-ing the embedding also has a 30% addition (just from one sample I saw), so this should allow photos with ~700 faces to go through. Ref: - https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size --- server/scripts/deploy/museum.nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/scripts/deploy/museum.nginx.conf b/server/scripts/deploy/museum.nginx.conf index ad3ee59f1a..6a49c0ef2f 100644 --- a/server/scripts/deploy/museum.nginx.conf +++ b/server/scripts/deploy/museum.nginx.conf @@ -18,6 +18,9 @@ server { server_name api.ente.io; + # Allow HTTP request body up to 4 MB (default is 1 MB). + client_max_body_size 4m; + location / { proxy_pass http://museum; proxy_http_version 1.1;