How to configure Nginx Gzip compression
来源:互联网 发布:python 推荐系统包 编辑:程序博客网 时间:2024/05/16 01:26
Enabling Gzip compression in Nginx is very easy, and allow us to save bandwidth transfer and also almost duplicate/triplicate our page speed. First step is edit nginx.conf file, that could be located somewhere /etc/nginx/nginx.conf or /usr/local/nginx/conf/nginx.conf, in most distributions.
Once there, you just need to add this code to the http section, like this:
http {.........# enable gzip compressiongzip on;gzip_min_length 1100;gzip_buffers 4 32k;gzip_types text/plain application/x-javascript text/xml text/css;gzip_vary on;# end gzip configuration.........}
Once you finish editing the file, just restart nginx:
/etc/init.d/nginx restart
How to test Gzip compression is working in Nginx?
[my@lan ~]$ curl --header "Accept-Encoding: gzip,deflate,sdch" -I http://www.nginxtips.comHTTP/1.1 200 OKServer: nginxDate: Tue, 26 Feb 2013 15:41:38 GMTContent-Type: text/html; charset=UTF-8Connection: keep-aliveVary: Accept-EncodingX-Pingback: http://www.nginxtips.com/xmlrpc.phpContent-Encoding: gzip
If you see “Content-Encoding: gzip”, that means your page was served using Nginx Gzip Module.
- How to configure Nginx Gzip compression
- How to configure Gzip for JBoss?---refer
- How To Optimize Your Site With GZIP Compression
- How to install and configure NGINX on CentOS 7
- How To Configure Hadoop
- How to configure XDebug
- How to configure the log4net
- how to configure L2TP VPN
- how to configure PPTP VPN
- How to configure NTP client
- How To Install and Configure Django with Postgres, Nginx, and Gunicorn
- How to configure environment to use JavaMail?
- Gzip compression/decompression
- Gzip compression/decompression
- How To Use GSM Compression in Low-level Wave Recording.
- How to install and configure bugzilla
- How to configure the network for Linux
- How to configure rsh on redhat Linux
- 修改wowpc变色龙
- 关于libgdx中UI控件的旋转和缩放的备忘
- IntelliJ编译时,致命错误:在路径和启动路径中找不到包java.lang
- KVM的虚拟化研究及应用
- Eclipse 安装插件(aptana、svn 、git、Java EE、JSHint)
- How to configure Nginx Gzip compression
- ora-09925 unable to create audit trail file
- 在CentOS中如何访问Windows NTFS分区
- 交通灯
- asp网站后台登陆超时解决办法
- Android开发中TextView属性详解
- 《Linux总线、设备与驱动》USB设备发现机制
- 数据库里的树
- 一个很牛的统计单词的方法