nginx1.6添加第三方模块nginx_concat_module合并http请求

Share on:

1.安装nginx_concat_module

存放模块的路径下

svn checkout http://code.taobao.org/svn/nginx_concat_module/trunk nginx_concat_module

前提要安装过svn

 

然后下载nginx 我下的是1.6版的

解压切换至解压目录

./configure --add-module=/刚才存放的路径/nginx_concat_module
make && make install

2.配置nginx_concat_module

打开需要配置网站的nginx vhost配置文件加入

location /resource/ {
	concat on;
        concat_max_files 10;
	concat_unique on;
        concat_types text/html,application/x-javascript,text/css;
 }

重启nginx,大功告成,没有压缩有点遗憾,毕竟很久没有维护了

http://shopncdemo2.fanhefan.com/resource/js/??jquery.js,common.js,jquery-ui/jquery.ui.js

大家也可以试试https://github.com/lanrenwo/icombo功能更强大些,不过不知道是否稳定哦~

 

 

 

 

闽ICP备12003472号-7