Lua调味的Nginx重写或内部redirect周期
我对nginx和lua都是新的。 我试图按照这个教程http://leafo.net/posts/creating_an_image_server.html#installation_requirements,但对于我的生活,我不能得到nginx.conf权利。 我已经检查了类似于这个问题的location其他问题,但我看不出我的代码有什么问题。 这里是nginx.conf : error_log stderr notice; daemon off; events { } http { include /usr/local/openresty/nginx/conf/mime.types; server { listen 6789; lua_code_cache on; location @image_server { content_by_lua_file "serve_image.lua"; } location ~ ^/images/(?<size>[^/]+)/(?<path>.*\.(?<ext>[a-z_]*))$ { root cache; try_files /$path @image_server; } } } 这是serve_image.lua代码 local sig, size, path, ext = ngx.var.sig,ngx.var.size,ngx.var.path,ngx.var.ext local images_dir =“images /” – 其中图片来自本地cache_dir […]