In my nginx conf I have which enabled gzip:
gzip on;
gzip_proxied any;
gzip_types text/plain text/css text/javascript;
gzip_comp_level 9;
gzip_vary on;
However this also gzips my jpeg's which actually increases size. How can I, ideally with out using location, disable gzipping of images?
Best Answer
If you didn't set
gzip_types image/jpeg
anywhere then nginx will never compress your jpegs, unless they have different content-type (liketext/plain
) in headers.This may be due to one of the following reasons:
gzip_types image/jpeg
in configuration;content-type
header;