2808 explained code solutions for 75 technologies


nginx-luaConcatenate string in Lua


server {
  location / {
    content_by_lua_block {
      local str1 = "Hi "
      local str2 = "All!"
      ngx.say(str1 .. str2)
    }
  }
}ctrl + c
content_by_lua_block

nginx-lua module directive to specify block of Lua code

local str1

defines first string

local str2

defines second string

str1 .. str2

concatenates str1 and str2