Chunked requests: nginx vs. traefik

Hi, I need to expose a django based service that implements a protocol that uses transfer-encoding: chunked that django does not cope with. If I put nginx in front everything works:

    location / {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
        proxy_pass       http://django:8000;
    }

if I use traefik I have an error on authentication, the same error I get when I go directly to django.
I guess it depends on a different behaviour of traefik related to chunking.

  1. Is there a way to tell traefik to forward request after having "de-chunked"?
  2. is there a way to sniff the traffic between traefik and the service (I'd have liked to use mitmproxy) I managed to do it as shown here.

TIA
sandro

1 Like

Solved.

buffering middleware mages that.
I added:

traefik.http.routers.mitm.middlewares: do-buffering  
traefik.http.middlewares.do-buffering.buffering.memRequestBodyBytes: 20000000        

sandro

3 Likes

Thanks a lot, this was the exact issue we were experiencing.