Configure gzip compression for nginx in CentOS

Source: Internet
Author: User
Gzip compression uses the http_gzip_module module. this module supports online real-time compression of output data streams, examples: gzipon; gzip_min_length1000; gzip_proxiedexpiredno-cacheno-storeprivateauth; gz

The http_gzip_module is used for gzip compression. this module supports online real-time compression of output data streams. example:


Gzip on;
Gzip_min_length 1000;
Gzip_proxied expired no-cache no-store private auth;
Gzip_types text/plain application/x-javascript text/css text/html application/xml;

Gzip on | off
Enable or disable the gzip module
Gzip_min _length 1000
Sets the minimum number of page bytes that can be compressed. the number of page bytes is obtained from Content-Length in the header.
The default value is 0, and most pages are compressed.
We recommend that you set the size to 1 kb. smaller than 1 KB may increase the pressure. That is, gzip_min_length 1024
Gzip_proxied expired no-cache no-store private auth;
Nginx is enabled when it is used as a reverse proxy. if you enable or disable the results returned by the backend server, the backend server must return the header containing ".
Gzip_types text/plain application/xml;
The MIME type is compressed (whether specified or not). The "text/html" type is always compressed.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.