How it works...
The first part of our configuration explicitly turns the gzip module on. Then, to maintain compatibility with really old versions of Internet Explorer (which hopefully nobody still uses), we disable gzip using the MSIE [1-6]\.(?!.*SV1) regex.
Then, gzip_proxied sets which proxied connections will use gzip, which we set to any to cover all requests. gzip_types is then used to set what file types are to be compressed. This is matched with the MIME type, for example, text/plain. We explicitly set types, as not every file type can be compressed further (for example, JPEG images).
Lastly, we set gzip_vary to on. This sets the Vary: Accept-Encoding header, which specifies that both Content Distribution Networks (CDN) and upstream ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access