2808 explained code solutions for 75 technologies


nginx-luaBase64 encode in Lua


server {
  location / {
    content_by_lua_block {
      local enc = ngx.encode_base64('value')
      ngx.say(enc)
    }
  }
}ctrl + c
content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.encode_base64

encode given value into base64

value

sample value to encode

ngx.say

output given text to client