9951 explained code solutions for 126 technologies


nginx-luaHello world with Nginx Lua module


server {
  location / {
    add_header Content-type text/plain;
    
    content_by_lua_block {
      ngx.say("Hello world")
    }
  }
}ctrl + c
content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.say

output given text to client

add_header Content-type text/plain;

specify default content type for the content generated by Lua