美文网首页web编程之路
nginx http_image_filter_module安装

nginx http_image_filter_module安装

作者: hopevow | 来源:发表于2016-09-22 09:45 被阅读44次

简单介绍

http_image_filter_module是nginx提供的集成图片处理模块,在网站访问量不是很高磁盘有限不想生成多余的图片文件的前提下可,就可以用它实时缩放图片,旋转图片,验证图片有效性以及获取图片宽高以及图片类型信息,由于是即时计算的结果,所以网站访问量大的话,不建议使用。

安装

在configure时需要指定,具体见nginx的安装
#./configure --with-http_image_filter_module

如报错,安装 gd-devel
#yum install gd-devel

简单配置(省略上下文):

    image_filter resize $arg_width $arg_height;
    error_page 415 = /empty;
}```

访问uri: /img/test.jpg?width=100&height=100

>官方文档:

http://nginx.org/en/docs/http/ngx_http_image_filter_module.html

相关文章

网友评论

    本文标题:nginx http_image_filter_module安装

    本文链接:https://www.haomeiwen.com/subject/bbkaettx.html