ente/server/scripts/deploy/museum.nginx.conf
Manav Rathi 0b3ca8db69
[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
2024-07-05 14:08:10 +05:30

34 lines
996 B
Plaintext

# This file gets loaded in a top level http block by the default nginx.conf
# See infra/services/nginx/README.md for more details.
upstream museum {
# https://nginx.org/en/docs/http/ngx_http_upstream_module.html
server host.docker.internal:8080 max_conns=50;
# Keep these many connections alive to upstream (requires HTTP/1.1)
keepalive 20;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/key.pem;
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;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}