Gzip
Determine whether to enable the gzip Module
Param: on | off
Example: gzip on;
Gzip_buffers
Set the size of gzip applied memory. The function is to apply for memory space by a multiple of the block size.
Param1: int
Param2: the unit behind int (k) is k.
Example: gzip_buffers 4 8 k;
Gzip_comp_level
Set the gzip compression level. The lower the level, the faster the compression speed, the smaller the File compression ratio. The slower the speed, the larger the File compression ratio.
Param: 1-9
Example: gzip_com_level 1;
Gzip_min_length
When the returned content is greater than this value, gzip is used for compression. The unit is K. When the value is 0, all pages are compressed.
Param: int
Example: gzip_min_length 1000;
Gzip_http_version
Used to identify the http protocol version. Earlier Browsers Do not support gzip compression, and garbled characters are displayed. Therefore, this option is added to support earlier versions. Currently, this option can be ignored.
Partam: 1.0 | 1.1
Example: gzip_http_version 1.0
Gzip_proxied
Nginx is enabled as the reverse proxy,
Param: off | expired | no-cache | no-sotre | private | no_last_modified | no_etag | auth | any]
Expample: gzip_proxied no-cache;
Off-Disable Data Compression For All proxy results
Expired-enable compression. If the header contains "Expires" header information
No-cache-enable compression. If the header contains the "Cache-Control: no-cache" header
No-store-enable compression. If the header contains the "Cache-Control: no-store" header
Private-enable compression. If the header contains "Cache-Control: private" header information
No_last_modified-enable compression. If the header contains "Last_Modified" header information
No_etag-enable compression. If the header contains "ETag" header information
Auth-enable compression. If the header contains "Authorization" header information
Any-unconditionally compress all result data
Gzip_types
Sets the MIME type to be compressed. Non-set values are not compressed.
Param: text/html | application/x-javascript | text/css | application/xml
Example: gzip_types text/html;
Demo
Gzip on;
Gzip_min_length 1000;
Gzip_buffers 4 8 k;
Gzip_types text/html application/x-javascript text/css application/xml;