root@ubuntu:/usr/local/src/nginx-1.14.2# nginx -t nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html) nginx: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found: no field package.preload['resty.core'] no file ' /usr/local/lib/lua-resty-core-0.1.17/lib/resty/core.lua' no file './resty/core.lua' no file '/usr/local/share/luajit-2.0.5/resty/core.lua' no file '/usr/local/share/lua/5.1/resty/core.lua' no file '/usr/local/share/lua/5.1/resty/core/init.lua' no file './resty/core.so' no file '/usr/local/lib/lua/5.1/resty/core.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './resty.so' no file '/usr/local/lib/lua/5.1/resty.so' no file '/usr/local/lib/lua/5.1/loadall.so')
# add support for img which has query params, # like: xxx.jpg?a=b&c=d_750x750.jpg if ($args ~* "^([^_]+)_(d+)+x(d+)+.(jpg|jpeg|gif|png)$") { set $w $2; set $h $3; set $img_ext $4;
# set var for thumb pic set $upload_path /var/filebase; set $img_original_root $upload_path;# original root; set $img_thumbnail_root $upload_path/cache/thumb; set $img_file $img_thumbnail_root$uri;
# like:/xx/xx/xx.jpg_100-.jpg or /xx/xx/xx.jpg_-100.jpg location ~* ^(.+.(jpg|jpeg|gif|png))_((d+-)|(-d+)).(jpg|jpeg|gif|png)$ { root $img_thumbnail_root; # root path for croped img set $img_size $3;
if (!-f $img_file) { # if file not exists add_header X-Powered-By 'Nginx+Lua+GraphicsMagick By Botao'; # header for test add_header file-path $request_filename; # header for test set $request_filepath $img_original_root$1; # origin_img full path:/document_root/1.gif set $img_size $3; # img width or height size depends on uri set $img_ext $2; # file ext content_by_lua_file /usr/local/nginx/lua/autoSize.lua; # load lua } }
if (!-f $img_file) { # if file not exists add_header X-Powered-By 'Nginx+Lua+GraphicsMagick By Botao'; # header for test add_header file-path $request_filename; # header for test set $request_filepath $img_original_root$1; # origin_img file path set $img_width $3; # img width set $img_height $4; # height set $img_ext $5; # file ext content_by_lua_file /usr/local/nginx/lua/cropSize.lua; # load lua } }
# if need (all go there) location ~* /upload { root $img_original_root; }