Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

If you didn't set gzip_types image/jpeg anywhere then nginx will never compress your jpegs, unless they have different content-type (like text/plain) in headers.

This may be due to one of the following reasons:

  • You have gzip_types image/jpeg in configuration;
  • Images returned with incorrect content-type header;
  • They compressed by something outside of nginx;
  • A tool that you're using for check is broken.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.