Git Product home page Git Product logo

nginx-lua-fastdfs-graphicsmagick's Introduction

nginx-lua-fastdfs-GraphicsMagick

fastdfs开源的分布式文件系统,此脚本利用nginx lua模块,动态生成图片缩略图,fastdfs只存一份原图。lua通过socket获取fastdfs的原图,并存放到本地,根据不同规则url,例如:_60x60.jpg、_80x80.jpg,类似淘宝图片url规则。利用gm命令生成本地缩略图,第二次访问直接返回本地图片。定时任务凌晨清除7天内未访问的图片,节省空间。

图片访问举例

  1. http://192.168.1.113/group1/M00/00/00/wKgBcVN0wDiAILQXAAdtg6qArdU189.jpg
  2. http://192.168.1.113/group1/M00/00/00/wKgBcVN0wDiAILQXAAdtg6qArdU189.jpg_80x80.jpg
  3. http://gi1.md.alicdn.com/imgextra/i1/401612253/T2ASPfXE4XXXXXXXXX_!!401612253.jpg_60x60.jpg
  4. http://gi1.md.alicdn.com/imgextra/i1/401612253/T2ASPfXE4XXXXXXXXX_!!401612253.jpg_80x80.jpg

参考网址

  1. https://github.com/openresty/lua-nginx-module
  2. https://github.com/azurewang/Nginx_Lua-FastDFS
  3. https://github.com/azurewang/lua-resty-fastdfs
  4. http://rhomobi.com/topics/23
  5. http://bbs.chinaunix.net/thread-4133106-1-1.html

nginx-lua-fastdfs-graphicsmagick's People

Contributors

hpxl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nginx-lua-fastdfs-graphicsmagick's Issues

定时任务的脚本

原脚本为查找7天内被访问的
0 2 * * * find /data/images -atime -7 | xargs rm -rf
应该为,前面是+
才是查找7天内没有被访问过的
0 2 * * * find /data/images -atime +7 | xargs rm -rf

nginx error.log显示这个错误

2016/01/26 10:32:04 [notice] 500577#0: 101 "/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/(.)" matches "/group1/M00/00/00/CgQbTlal2hmAU9viAAUBXOkTyek689.jpg", client: 10.4.4.4:444, server: localhost, request: "GET /group1/M00/00/00/CgQbTlal2hmAU9viAAUBXOkTyek689.jpg HTTP/1.1", host: "10.4.4.4:444"
2016/01/26 10:32:04 [error] 500577#0: *101 lua entry thread aborted: runtime error: /usr/local/nginx-1.8.0/conf/lua/restyfastdfs.lua:61: attempt to index upvalue 'bit' (a nil value)
stack traceback:
coroutine 0:
/usr/local/nginx-1.8.0/conf/lua/restyfastdfs.lua:61: in function 'int2buf'
/usr/local/nginx-1.8.0/conf/lua/restyfastdfs.lua:471: in function 'query_download_storage_ex'
/usr/local/nginx-1.8.0/conf/lua/restyfastdfs.lua:462: in function 'query_download_storage'
/usr/local/nginx-1.8.0/conf/lua/restyfastdfs.lua:513: in function 'do_download'
/usr/local/nginx-1.8.0/conf/lua/fastdfs.lua:50: in function </usr/local/nginx-1.8.0/conf/lua/fastdfs.lua:1>, client: 10.4.4.4, server: localhost, request: "GET /group1/M00/00/00/CgQbTlal2hmAU9viAAUBXOkTyek689.jpg HTTP/1.1", host: "10.4.4.4:444"

restyfastdfs.lua

coroutine 0:
/usr/local/nginx/conf/lua/restyfastdfs.lua: in function 'query_download_storage'
/usr/local/nginx/conf/lua/restyfastdfs.lua:513: in function 'do_download'
/usr/local/nginx/conf/lua/fastdfs.lua:50: in function </usr/local/nginx/conf/lua/fastdfs.lua:1>, client: 192.168.200.1, server: www.fastdfs.dev, request: "GET /group1/M00/00/00/22.jpg HTTP/1.1", host: "www.fastdfs.dev"
2017/12/03 00:10:38 [error] 34696#0: *16 lua entry thread aborted: runtime error: /usr/local/nginx/conf/lua/restyfastdfs.lua:463: attempt to index local 'res' (a nil value)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.