<div dir="ltr"><div>I have a set directive inside an http block which I thought was valid but when I run config -t it says the nginx: [emerg] "set" directive is not allowed here.<br><br><br>http {<br><br>    log_format bodylog '$remote_addr - $remote_user [$time_local] '<br>      '"$request" $status $body_bytes_sent '<br>      '"$http_referer" "$http_user_agent" $request_time '<br>      '<"$request_body" >"$resp_body"';<br><br>     lua_need_request_body on;<br><br>     <b>set $resp_body "";</b><br>     body_filter_by_lua '<br>        local resp_body = ngx.arg[1]<br>        ngx.ctx.buffered = (ngx.ctx.buffered or "") .. resp_body<br>        if ngx.arg[2] then<br>           ngx.var.resp_body = ngx.ctx.buffered<br>        end<br>       ';<br><br>.....<br><br></div>Joel<br><div><br></div></div>