1.在nginx的conf下配置lua.conf。。。。。。vi lua.conf
server { listen 80; server_name _; location /lua { default_type 'text/html'; lua_code_cache off; content_by_lua_file /usr/local/openrestry/lua/test.lua; } }
2.在nginx.conf配置指向lua.conf,在nginx.conf的http内配置,路径根据自己情况定义
http { include mime.types; default_type application/octet-stream; //..... lua_package_path "/usr/local/openresty/lualib/?.lua;;"; lua_package_cpath "/usr/servers/openresty/?.so;;"; include lua.conf; }