用 ngx_openresty/
1.0.15.11版本,加载lua字节码文件时,会报错: failed to load Lua inlined code: bad byte-code header in /opt/openresty/nginx/conf/test.luac
test.lua的内容只有一行:ngx.say('hello world'), 用luac -o test.luac test.lua生成的字节码文件。lua版本为Lua 5.1.4
nginx配置为:
http {
access_log off;
lua_package_path "/opt/openresty/nginx/?.lua;/opt/openresty/lualib/?.lua;;";
server {
listen 8000;
location /test {
content_by_lua_file conf/test.luac;
}
}
}
请教应该怎么正确的加载lua字节码文件呢?