9951 explained code solutions for 126 technologies


nginx-luaHow to do URL encode


server {
  location / {
    content_by_lua_block {
      ngx.say( ngx.escape_uri('hi all') )
    }
  }
}ctrl + c
content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.escape_uri

encodes given string to URL-encoded form

'hi all'

sample string to encode

ngx.say

output given text to client