Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Fix n8n Webhook 413 Payload Too Large on Docker & Nginx (The 3-Layer Solution)

Description and use

After configuring limits in Nginx, n8n, and Node.js, webhooks up to 64 MiB are accepted without 413 errors, and workflows run fully.

Problem

n8n webhooks return HTTP 413 or PayloadTooLargeError when receiving large payloads, even after setting Nginx client_max_body_size.

Outcome

After adjusting Nginx, n8n, and Node.js limits, large webhook payloads up to 64 MiB are accepted, 413 errors disappear, and workflows execute fully.

Workflow

  • 1. Identify rejecting layer by sending test payload to public URL and to localhost; inspect response and logs.
  • 2. If Nginx rejects, edit /etc/nginx/sites-available/n8n to set client_max_body_size 64m for webhook locations and adjust timeouts.
  • 3. If n8n rejects, update docker‑compose.yml with environment variables N8N_PAYLOAD_SIZE_MAX=64, N8N_FORMDATA_FILE_SIZE_MAX=250, N8N_DEFAULT_BINARY_DATA_MODE=filesystem, NODE_OPTIONS=--max-old-space-size=4096.
  • 4. Recreate container with docker compose up -d --force-recreate and verify env vars.
  • 5. Re‑run 20 MB test payload through public URL to confirm HTTP 200 and execution history.
  • 6. Apply best practices: keep Nginx limit ≥ n8n limit, avoid base64 binaries, consider Cloudflare limits.

Evidence

Why raising Nginx client_max_body_size still triggers 413 errors on n8n webhooks.

Source

The workflow execution log in n8n is completely blank.

Source

client_max_body_size 1MB Default

Source

N8N_PAYLOAD_SIZE_MAX 16MiB Default

Source

NODE_OPTIONS=--max-old-space-size=4096

Source

  • Record date: 2026-10-11T09:41:19.250Z