nginx-luaHow to do URL decode
server {
  location / {
    content_by_lua_block {
      ngx.say( ngx.unescape_uri('hi%20all') )
    }
  }
}ctrl + c| content_by_lua_blocknginx-lua module directive to specify block of Lua code | ngx.unescape_uridecodes given string from URL-encoded form | 
| hi%20allsample string to decode | ngx.sayoutput given text to client | 
Usage example
ngx.say( ngx.unescape_uri('hi%20all') )output
hi all
Related
More of Nginx Lua
- How to install Nginx Lua module in Ubuntu 22.04
- How to sleep in code
- Get client IP address
- How to use subrequests
- How to generate UUID
- How to send plain text response
- How to modify response header with Lua
- How to return 404 status code
- How to log request body
- How to read file
See more codes...