nginx configuration gzip
Jul 29, 2016 am 08:55 AM
application
gzip
javascript
nginx
quot
开1, Vim opens the nginx configuration file
vim /usr/local/nginx/conf/nginx.conf
2, find the following paragraph, modify gzip on;gzip_min_length 1k;
gzip_buffers 4 16k;
#gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary off;
gzip_disable "MSIE [1-6].";3. ExplainLine 1: Turn on GzipLine 2: No compression threshold, greater than Only 1K is compressed, and generally there is no need to change it. Line 3: buffer is, well, forget it, I won’t explain it, no need to change it Line 4: If a reverse proxy is used, the terminal communication is HTTP/1.0, if necessary You shouldn’t need to read my popular science article; if you have this sentence, just comment it. The default is HTTP/1.1Line 5: Compression level, 1-10. The larger the number, the better the compression and the longer the time. , feel free to change it depending on your moodLine 6: The file type to be compressed, just fill in whatever is missing. There are two ways to write JavaScript, it is best to write them both. There are always people who complain that js files are not compressed. In fact, write one more Just use this formatLine 7: It is related to caching services such as Squid. If it is on, "Vary: Accept-Encoding" will be added to the Header. I don't need this thing. I can figure it out by myself.Line 8 : IE6 is not very friendly to Gzip and does not give it Gzip anymore4. Reload Nginx/usr/local/nginx/sbin/nginx -s reload5. Use curl to test whether Gzip is successfully turned on
Content -Encoding: gzip
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to allow external network access to tomcat server

What are the nginx start and stop commands?

How to deploy nodejs project to server

How to solve the problem of nginx when accessing the website

How to communicate between docker containers
