您好,欢迎访问一九零五行业门户网

[openresty] hello world

[openresty] hello world
openresty软件部署
不说了,和nginx差不多的。
content_by_lua指令
可以用content_by_lua指令将一段lua代码包含到nginx里面去执行,比如下面最简单的调用ngx.say来输出hello world。
location / { default_type text/html; content_by_lua ' ngx.say(hello, world
) '; }
长一些的代码适合用rewrite_by_lua_file
后面就跟一个path路径
location / { content_by_lua_file lua/hello.lua; }[root@test nginx]# cat lua/hello.luangx.say(hello, world!!! hey man
)
lua_code_cache
默认nginx对lua代码段有一层缓存,提高了效率,但是这也让我们每次修改完lua以后需要reload nginx才能生效,这时候我们可以关掉cache,实时生效,等调试完毕以后再打开。
lua_code_cache off;
').addclass('pre-numbering').hide(); $(this).addclass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了[openresty] hello world,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息