Access & rate limiting

Raise the upload size limit (fix 413)

2 min · updated June 16, 2026

Nginx rejects request bodies larger than 1 MB by default, returning 413 Request Entity Too Large before the request ever reaches your app. Raise the limit to whatever you actually want to allow.

Site-wide (in http { } or a server { }):

client_max_body_size 100m;

Or just on the upload endpoint, keeping the rest tight:

location /upload {
    client_max_body_size 500m;
    proxy_pass http://127.0.0.1:3000;

    # Big uploads can take a while — don't time out mid-transfer.
    proxy_request_buffering off;   # stream to the backend instead of buffering whole body to disk
    proxy_read_timeout  300s;
    proxy_send_timeout  300s;
}

Details:

sudo nginx -t && sudo nginx -s reload

← All snippets