9

I'm using traefik docker image v1.5, and when I try to upload a big file (like 1GB), traefik closes the connection and logs: exceeding the max size 4194304 So is there any way to modify/remove this default restriction?

Agas
  • 157
  • 2
  • 7

2 Answers2

4

Traefik uses a Buffering middleware that gives you control on how you want to read the requests before sending them to services.

With Buffering, Traefik reads the entire request into memory (possibly buffering large requests into disk), and rejects requests that are over a specified limit.

This can help services deal with large data (multipart/form-data for example), and can minimize time spent sending data to a service.

Example configuration:

[backends]
  [backends.backend1]
    [backends.backend1.buffering]
      maxRequestBodyBytes = 10485760  
      memRequestBodyBytes = 2097152  
      maxResponseBodyBytes = 10485760
      memResponseBodyBytes = 2097152
      retryExpression = "IsNetworkError() && Attempts() <= 2"

With the maxRequestBodyBytes option, you can configure the maximum allowed body size for the request (in Bytes).

If the request exceeds the allowed size, it is not forwarded to the service and the client gets a 413 (Request Entity Too Large) response.

Traefik Buffering Documentation

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
NicoKowe
  • 2,989
  • 2
  • 19
  • 26
0

For me, the problems is not with V2 of Traefik, but with Cloudflare. Cloudflare limits max uploads to 100Mb on free accounts.

I had to upload with a internal URL to get around this issue.

Phong Phuong
  • 369
  • 4
  • 8