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

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

说明与用途

在 Docker 中自托管 n8n 并通过 Nginx 代理时,较大的 webhook 负载会导致 413 错误。解决方案包括三步:定位拒绝层、提升 Nginx 限制、调整 n8n 与 Node.js 的负载上限。配置后可接受高达 100 MB 的请求。

问题

n8n self-hosted behind Nginx receives 413 Payload Too Large errors for large webhook payloads, with no workflow log entry.

结果

After configuring Nginx, n8n, and Node.js limits, large webhook payloads up to 100 MB are accepted and processed without 413 errors.

工作流

  • Identify which layer rejects the payload by sending a test request to the public URL and to localhost; examine error signatures.
  • If Nginx rejects, edit the Nginx config to set client_max_body_size 64m; and adjust timeouts for the webhook location block.
  • Reload Nginx with sudo nginx -t && sudo systemctl reload nginx.
  • If n8n rejects, set environment variables N8N_PAYLOAD_SIZE_MAX=64MiB and N8N_FORMDATA_FILE_SIZE_MAX=200MiB in the Docker compose or container launch command.
  • Adjust Node.js V8 heap size by setting --max-old-space-size=4096 (4 GB) when starting the n8n container.
  • Restart the n8n container and verify large payloads succeed.

证据

The request was dropped before the Webhook node ever received it.

来源

client_max_body_size 64m;

来源

N8N_PAYLOAD_SIZE_MAX: 16MiB Default

来源

  • 记录日期: 2026-10-10T04:55:50.454Z