9951 explained code solutions for 126 technologies


nginx-luaHow to return 200 status code


server {
  location / {
    content_by_lua_block {
      ngx.say('ho ho ho')
      ngx.exit(ngx.HTTP_OK)
    }
  }
}ctrl + c
content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.say

output given text to client

ngx.exit

end response with specified status code

ngx.HTTP_OK

HTTP code 200, see list of available codes