9951 explained code solutions for 126 technologies


nginx-luaHow to use for loop


server {
  location / {
    content_by_lua_block {
      for i = 1,10,1
      do 
        ngx.say(i)
      end
    }
  }
}ctrl + c
content_by_lua_block

nginx-lua module directive to specify block of Lua code

for i = 1,10,1

for loop from 1 to 10 with increment step of 1

ngx.say

output given text to client