My setup looks like this: User->Cloudfront->Nginx->gunicorn
Apparently nginx, doesn't compress (gzip) when there is a CDN inbetween (Via header present) so my nginx sends:
Transfer-encoding: chunked
and according to HTTP/1.1 Content-length is not allowed when it is chunked. Since cloudfront doesn't see content-length header, it doesn't compress neither and my user gets non-compressed responses.
I did
gzip_proxied no-cache no-store private expired auth;
to make sure nginx compresses even though there is a CDN inbetween but this felt like a hack.. Is my cloudfront configuration wrong, or is it weird that my nginx sends chunked?
What am I doing obviously wrong as the default values result in user getting non-compressed files?