This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Debian packages nginx-extras, lua-zlib required | |
ngx.ctx.max_chunk_size = tonumber(ngx.var.max_chunk_size) | |
ngx.ctx.max_body_size = tonumber(ngx.var.max_body_size) | |
function create_error_response (code, description) | |
local message = string.format('{"status":400,"statusReason":"Bad Request","code":%d,"exception":"","description":"%s","message":"HTTP 400 Bad Request"}', code, description) | |
ngx.status = ngx.HTTP_BAD_REQUEST | |
ngx.header.content_type = "application/json" | |
ngx.say(message) |