Mastering Nginx

(Ron) #1

Reverse Proxy Advanced Topics


[ 112 ]

The following table lists the directives available with the gzip module:


Table: Gzip module directives

Directive Explanation
gzip Enables or disables the compression of
responses.
gzip_buffers Specifies the number and size of buffers used
for compressing a response.
gzip_comp_level The gzip compression level (1-9).
gzip_disable A regular expression of User-Agents that
shouldn't receive a compressed response. The
special value msie6 is a shortcut for MSIE
[4-6]\. excluding MSIE 6.0; ... SV1.
gzip_min_length The minimum length of a response before
compression is considered, determined by the
Content-Length header.
gzip_http_version The minimum HTTP version of a request
before compression is considered.
gzip_proxied Enables or disables compression if the request
has already come through a proxy. Takes one
or more of the following parameters:

•    off: Disables compression
• expired: Enables compression
if the response should not be
cached, as determined by the
Expires header
• no-cache: Enables
compression if the Cache-
Control header is equal to
no-cache

•    no-store: Enables
compression if the Cache-
Control header is equal to
no-store
• private: Enables compression
if the Cache-Control header
is equal to private
Free download pdf