9951 explained code solutions for 126 technologies


nginx-luaHow to set global variable


init_by_lua_block {
  author = 'OLH'
}

server {
  location / {
    content_by_lua_block {
      ngx.say(author);
    }
  }
}ctrl + c
init_by_lua_block

nginx-lua module directive to run specified Lua code on server startup

author = 'OLH'

set global variable value

content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.say

output given text to client