9951 explained code solutions for 126 technologies


nginx-luaHow to generate UUID


init_by_lua_block {
  local uuid = require("uuid")
}

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

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

content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.say

output given text to client

uuid()

UUID module function that returns generated UUID string value

require("uuid")

load Luarocks UUID module