nginx里面将lua_code_cache设置为off,可以关闭cache,这样在开发调试的时候不必重启或者reload nginx lua代码即可以生效。但是不宜用在生产环境,主要是影响效率。
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
access_log logs/access.log;
error_log logs/error.log;
location / {
lua_code_cache off;
access_by_lua_file lua/main.lua;
proxy_pass http://127.0.0.1:10080;
}
}
}